PDA

View Full Version : Question


enzulikeS
31/01/2018, 11:59 AM
How I can add a filterscript into the gamemode script, not the filterscript folder?

FaLLenGirL
31/01/2018, 12:10 PM
Do you want to say how to transform a filterscript into a gamemode ? Or how to make one script from the filterscript and gamemode.
If you want to make a gamemode from a filterscript you must replace:

"OnFilterScriptInit" with "OnGameModeInit"
"OnFilterScriptExit" with "OnGameModeExit"

to delete #if defined FILTERSCRIPT or #FILTERSCRIPT etc, after that you must move the filterscript that will be now a gamemode into the gamemodes folder, also don't forget about main(){}, you must put this at the top of the gamemode or above "OnGameModeInit" public.

DON'T FORGET TO RECOMPILE THE SCRIPT, if you want the changes that you made to be saved. :]]

enzulikeS
31/01/2018, 12:33 PM
I mean i don't know how to insert the filterscript into the gamemode

HNIC
31/01/2018, 12:35 PM
1. You place the filterscript to "Filterscripts" -folder. Open server.cfg, and add the name of the filterscript to the line which starts with "filterscripts". Hope I helped!

enzulikeS
31/01/2018, 01:24 PM
1. You place the filterscript to "Filterscripts" -folder. Open server.cfg, and add the name of the filterscript to the line which starts with "filterscripts". Hope I helped!

i said not this way
i don't want to put the filterscript

i want the code from the filterscript inserted to my gamemode..

HNIC
31/01/2018, 01:40 PM
i said not this way
i don't want to put the filterscript

i want the code from the filterscript inserted to my gamemode..

Oh. In that case, open the filterscript in Pawno. copy the variables to the gamemode script. (Doublecheck that there isnīt any conflicts)

Next, lets say for example that this is your filterscript:


public OnPlayerConnect(playerid)
{
new string[64], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,sizeof string,"%s has joined the server. Welcome!",pName);
SendClientMessageToAll(0xFFFFFFAA,string);
return 1;
}


Find OnPlayerConnect -callback from your gamemode, then copy everything that is inside the filterscripts callback (I painted it red in my example) under the gamemodesī OnPlayerConnect -callback.