Need Help with Trucker job [2]
#2

Calling remote function is one way. PVars is the other way.

You need to call from filterscript the public function `GivePlayerCash` of the gamemode. Replace `GivePlayerMoney` function to `GivePlayerMoneyEx` at the filterscript:
pawn Код:
// filterscript:
GivePlayerMoneyEx(playerid, amount)
{
    CallRemoteFunction("GivePlayerCash", "dd", playerid, amount);
}
The filterscript uses `GetPlayerMoney` function, you will need to add another remote function to get the value of the variable from the gamemode. I am sure you have a function to get the server-side money value in your gamemode but make it a public function:
pawn Код:
// gamemode:
forward GetPlayerCash(playerid);
public GetPlayerCash(playerid)
{
    return PlayerInfo[playerid][pCash];
}
At the filterscript now, replace `GetPlayerMoney` to `GetPlayerMoneyEx`.
pawn Код:
// filterscript:
GetPlayerMoneyEx(playerid)
{
    return CallRemoteFunction("GetPlayerCash", "d", playerid);
}
Reply


Messages In This Thread
Need Help with Trucker job [2] - by TheAftermath - 29.09.2018, 09:55
Re: Need Help with Trucker job [2] - by Calisthenics - 29.09.2018, 14:10
Re: Need Help with Trucker job [2] - by TheAftermath - 30.09.2018, 09:01
Re: Need Help with Trucker job [2] - by TheAftermath - 30.09.2018, 09:32
Re: Need Help with Trucker job [2] - by Calisthenics - 30.09.2018, 09:42
Re: Need Help with Trucker job [2] - by TheAftermath - 30.09.2018, 09:47
Re: Need Help with Trucker job [2] - by Calisthenics - 30.09.2018, 09:56
Re: Need Help with Trucker job [2] - by TheAftermath - 01.10.2018, 13:46

Forum Jump:


Users browsing this thread: 2 Guest(s)