Very strange bug with money
#1

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.
Код:
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);
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.
Reply


Messages In This Thread
Very strange bug with money - by bobsona - 10.11.2014, 19:09
Respuesta: Very strange bug with money - by aoEXE - 10.11.2014, 19:22
Re: Very strange bug with money - by bobsona - 10.11.2014, 19:24
Re: Very strange bug with money - by Dziugsas - 10.11.2014, 20:22
Re: Very strange bug with money - by bobsona - 10.11.2014, 20:52
Re: Very strange bug with money - by meta1 - 10.11.2014, 20:54
Re: Very strange bug with money - by bobsona - 10.11.2014, 20:57
Re: Very strange bug with money - by meta1 - 10.11.2014, 21:06
Re: Very strange bug with money - by bobsona - 10.11.2014, 21:48
Re: Very strange bug with money - by bobsona - 11.11.2014, 09:06

Forum Jump:


Users browsing this thread: 1 Guest(s)