Variable problem
#1

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);
}
Reply
#2

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?
Reply
#3

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)