Filterscript and Gamemode? - 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: Filterscript and Gamemode? (
/showthread.php?tid=528428)
Filterscript and Gamemode? -
alanhutch - 27.07.2014
Hi all...
I have a RP gamemode and a Vehicle System FS.
It's all perfect, but when I buy a vehicle, the money doesn't decrease, because of Gamemode anti-moneyhack.
I have tried to add in the FS the PlayerInfo[playerid][pCash] and OnPlayerSave, but nothing happens...
What can I do?
Thanks
Re: Filterscript and Gamemode? -
alanhutch - 27.07.2014
Sorry the doublepost, but this is very urgent
Re: Filterscript and Gamemode? -
Sharpadox - 28.07.2014
I would use properties, so your Gamemode can communicate with the Filterscript.
https://sampwiki.blast.hk/wiki/Setproperty
https://sampwiki.blast.hk/wiki/Getproperty
Or u can use the GVar-Plugin (would be easier) to create global variables.
https://sampforum.blast.hk/showthread.php?tid=151076
Re: Filterscript and Gamemode? -
alanhutch - 28.07.2014
Can you help me with some examples please?
Re: Filterscript and Gamemode? -
Stinged - 28.07.2014
In your gamemode:
pawn Код:
forward PlayerCash(playerid);
public PlayerCash(playerid)
{
return PlayerInfo[playerid][pCash];
}
In your filterscript:
pawn Код:
#define PlayerCash(%0) CallRemoteFunction("PlayerCash", "i", %0);
Do the same with giving money.