Quote:
Originally Posted by Calisthenics
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); }
|
It did work but the issue now is the weapon.. is there a way to fix this too? as you can see in filterscript, there is a line for giveweapon .. its not giving the weapon.. thanks for fixing the money issue.. +rep