Variable problem - 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: Variable problem (
/showthread.php?tid=551261)
Variable problem -
Marcuse - 17.12.2014
Okay so here is the problem
I have a stock for adding money but the problem is that it doesnt add the money but sets it to the value assigned
So here is my stock
Код:
stock ACLA_GivePlayerMoney(playerid, iznos)
{
if(iznos > 0)
{
PlayerInfo[playerid][pNovcanik] += iznos;
GivePlayerMoney(playerid, iznos);
new kolikopara[40];
format(kolikopara,sizeof(kolikopara),"~g~+%d$",iznos);
TextDrawSetString(MinusiPlus[playerid], kolikopara);
TextDrawShowForPlayer(playerid, MinusiPlus[playerid]);
}
else
{
new konacaniznos = iznos * -1;
PlayerInfo[playerid][pNovcanik] -= konacaniznos;
GivePlayerMoney(playerid, -konacaniznos);
new kolikopara[40];
format(kolikopara,sizeof(kolikopara),"~r~%d$",iznos);
TextDrawSetString(MinusiPlus[playerid], kolikopara);
TextDrawShowForPlayer(playerid, MinusiPlus[playerid]);
}
SetTimerEx("NestaniNetacni", 3000, false, "ii", playerid,2);
}
Re: Variable problem -
Schneider - 17.12.2014
The code looks alright, are you sure the right values are passed to that stock and/or the player's money is not reset somehow?
Re: Variable problem -
Marcuse - 18.12.2014
ah it was reset i mean it was set in the command but i didnt see that line there was a = value right after my stock thanks