Question - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Question (
/showthread.php?tid=648956)
Question -
enzulikeS - 31.01.2018
How I can add a filterscript into the gamemode script, not the filterscript folder?
Re: Question -
FaLLenGirL - 31.01.2018
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. :]]
Re: Question -
enzulikeS - 31.01.2018
I mean i don't know how to insert the filterscript into the gamemode
Re: Question -
HNIC - 31.01.2018
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!
Re: Question -
enzulikeS - 31.01.2018
Quote:
Originally Posted by HNIC
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..
Re: Question -
HNIC - 31.01.2018
Quote:
Originally Posted by enzulikeS
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.