10.11.2014, 19:09
Hello,
I have very strange bug.
I'll try to explain it.
If I have $1 000 000 in my account and I deposit the money in the bank, I will have $0.
After I die I get the same amount $1 000 000, but I should have $-1000.
I think the problem is somewhere in OnPlayerDeath, so I'll give you some code.
As far as I can see, the money is saved in the variable pInfo[playerid][Money].
When you respawn, the money is loaded from the same variable and should not be a problem, but it has, as described above.
Any ideas?
P.S. Sorry for my bad English and I hope you can understand my problem.
I have very strange bug.
I'll try to explain it.
If I have $1 000 000 in my account and I deposit the money in the bank, I will have $0.
After I die I get the same amount $1 000 000, but I should have $-1000.
I think the problem is somewhere in OnPlayerDeath, so I'll give you some code.
Код:
public OnPlayerDeath(playerid, killerid, reason) { djSetInt("stats.json","players/died",djInt("stats.json","players/died")+1); pInfo[playerid][Deaths]++; if(killerid != INVALID_PLAYER_ID && killerid != playerid) { pInfo[killerid][Kills]++; } GivePlayerMoney(killerid, 5000); GivePlayerMoney(playerid, -1000); pInfo[playerid][Money] = GetPlayerMoney(playerid); SetPlayerScore(killerid, GetPlayerScore(killerid) + 5);
When you respawn, the money is loaded from the same variable and should not be a problem, but it has, as described above.
Any ideas?
P.S. Sorry for my bad English and I hope you can understand my problem.