SA-MP Forums Archive
Adding a value to a value and saving it - 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: Adding a value to a value and saving it (/showthread.php?tid=447588)



Adding a value to a value and saving it - thimo - 30.06.2013

Okay i got this:
pawn Код:
format(string4, sizeof(string4), "UPDATE Users SET ECoins = '%i' WHERE Name = '%s'", APlayerData[playerid][ECoins] + Coins, pName);
But the APlayerData[playerid][ECoins] variable stays at zero because its not added. How to make it Add Coins to AplayerData[playerid][ECoins] and actually make it save into APlayerdata[playerid][Ecoins]? Please help


Re: Adding a value to a value and saving it - Scottas - 30.06.2013

Код:
APlayerData[playerid][ECoins] += Coins;
format(string4, sizeof(string4), "UPDATE Users SET ECoins = '%i' WHERE Name = '%s'", APlayerData[playerid][ECoins], pName);