[Tutorial] Getting your filterscripts and gamemodes to share information
#8

Quote:
Originally Posted by oblexive
Посмотреть сообщение
Im editing a gm and iv added a vehicle system. Im trying to access the way the main gm handles cash from the filterscript. How would I access the stock:
stock GiveZaiatMoney(playerid, amount)
From the filterscript?
Make that stock a public.
pawn Код:
forward GiveZaiatMoney(playerid, amount);
public GiveZaiatMoney(playerid, amount)
Then call it using this in your filterscript:
pawn Код:
CallRemoteFunction("GiveZaiatMoney", "ii", playerid, amount);
You can also get data from your gamemode to your filterscript using this:

Gamemode:
pawn Код:
new PlayerMoney[MAX_PLAYERS];

forward Player_GetMoney(playerid);
public Player_GetMoney(playerid)
{
    return PlayerMoney[playerid];
}
Filterscript:
pawn Код:
new Money = CallRemoteFunction("Player_GetMoney", "i", playerid);
This will make your filterscript execute a public function which is located in your gamemode, get the data and return it back to your filterscript, to be stored in the variable Money for further use.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)