problems with SetPVarInt - 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: problems with SetPVarInt (
/showthread.php?tid=539984)
problems with SetPVarInt -
GwENiko - 01.10.2014
i am trying to give server sided cash to the player when he kills someone, and to the player who died. But, when i try compiling my code
Quote:
\(2125) : error 029: invalid expression, assumed zero
(2125) : warning 215: expression has no effect
(2125) : error 001: expected token: ";", but found ")"
(2125) : error 029: invalid expression, assumed zero
(2125) : fatal error 107: too many error messages on one line
|
pawn Код:
if(reason != 49 || reason != 50)
{
GivePlayerMoney(playerid, 100);
SetPVarInt(killerid, "pMoney", +=kMoney);
SetPVarInt(playerid, "pMoney", -dMoney);
ResetPlayerMoney(killerid);
ResetPlayerMoney(playerid);
GivePlayerMoney(killerid, GetPVarInt(playerid, "pMoney"));
GivePlayerMoney(playerid, GetPVarInt(playerid, "pMoney"));
spawned[playerid] = false;
i am dead tired, thus i can't figure out what is going, help pl0x
Re: problems with SetPVarInt -
ThePhenix - 01.10.2014
PHP код:
SetPVarInt(killerid, "pMoney", +=kMoney);
That's not right, the proper way should be:
PHP код:
SetPVarInt(killerid, "pMoney", GetPVarInt(playerid, "pMoney")+kMoney);
Re: problems with SetPVarInt -
Pottus - 01.10.2014
Going to suggest you read through this.
https://sampforum.blast.hk/showthread.php?tid=268499