Quote:
Originally Posted by RealCop228
Basically, doing this:
pawn Код:
SetPVarInt(playerid, "Money", 100);
... is the same as doing this:
pawn Код:
PlayerInfo[playerid][pMoney] = 100;
So, you would basically need to change every line like this:
pawn Код:
PlayerInfo[playerid][pMoney]++;
to this:
pawn Код:
SetPVarInt(playerid, "Money", GetPVarInt(playerid, "Money")++);
So, your code...
pawn Код:
PlayerInfo[i][pCash] -= cost;
Could easily become:
pawn Код:
SetPVarInt(playerid, "Money", GetPVarInt(playerid, "Money") - cost);
NOTE: The variable names you use in PVars (i.e. "Money") are case sensitive. So, MONEY, is not equal to Money. I would recommend to make everything a CAPITAL variable, just to be on the safe side.
|
Brilliant mate! I've been scripting for a little while now but when I don't understand something or don't know something I come to a brickwall sometimes as to WHAT I need to know exactly. You just told me EXACTLY what I need to know and that made perfect sense! I'll give this ago mate thanks alot! I don't know loads but I'm a quick learner! =]
EDIT: You should update the wiki as this made better sense lol..
EDIT after adding your code:
Ignore what I just put (Edited because I wrote incorrectly and found where I went wrong)
Thanks for the code man I'll see if this works!