problems with SetPVarInt
#1

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
Reply
#2

PHP код:
SetPVarInt(killerid"pMoney", +=kMoney); 
That's not right, the proper way should be:

PHP код:
SetPVarInt(killerid"pMoney"GetPVarInt(playerid"pMoney")+kMoney); 
Reply
#3

Going to suggest you read through this.

https://sampforum.blast.hk/showthread.php?tid=268499
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)