SA-MP Forums Archive
about LoadFilterscript() - 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: about LoadFilterscript() (/showthread.php?tid=580039)



about LoadFilterscript() - PowerF - 02.07.2015

What is different about
Код:
LoadFilterscript()
and
Код:
OnFilterScriptInit
i want to move all filterscript to gamemodes so it optimized
where should i put this lines at?
Код:
public LoadFilterscript()
{
    LoadDealerships();
	LoadDealershipCars();
	
	for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { LoadPlayerVehicleData(i); } }
	return 1;
}



Re: about LoadFilterscript() - Youssef221 - 02.07.2015

firstly, LoadFilterscript is when a filterscript is loaded (scripted in a gamemode), but OnFilterScriptInit is used the filterscript is loaded (scripted in a filterscript), But I recommend to use OnFilterScriptInit (on a filterscript).

secondly, do you mean under OnGameModeInit? If so, then here:

pawn Код:
public OnGameModeInit()
{
        LoadDealerships();
    LoadDealershipCars();
   
    for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { LoadPlayerVehicleData(i); } }
    return 1;
}



Re: about LoadFilterscript() - Onfroi - 02.07.2015

There is no LoadFilterscript() native in SA-MP, to load a filterscript from the gamemode you have to use SendRconCommand("loadfs (name of fs)"). Also, OnFilterScriptInit has nothing to do with the gamemode.