SA-MP Forums Archive
One last single bug, I hope - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: One last single bug, I hope (/showthread.php?tid=156724)



One last single bug, I hope - reallifescript - 23.06.2010

Hey

I've got 1 bug
Almost got my GM finished, but there is one thing my mate told me(i've check it, he's right)

When you die, The money is resetted

Me and my mates check the whole OnPlayerDeath, OnPlayerSpawn
We weren't able to find any suggestions why the money is resetted

Can somebody help me?

Tell me what you need to get it fixed (no, I won't post the full gamemode)


Re: One last single bug, I hope - TouR - 23.06.2010

Can you post OnPlayerDeath ?


Re: One last single bug, I hope - reallifescript - 23.06.2010

http://pastebin.com/ihRTUGQQ = On Player Death


Re: One last single bug, I hope - TouR - 23.06.2010

Do you use any anticheat?


Re: One last single bug, I hope - reallifescript - 23.06.2010

Nope, I don't

I've got a Register/login system, but that only saves on disconnect and load in login if I am right


Re: One last single bug, I hope - TouR - 23.06.2010

It looks weird dude! I cant think any other reason that happens


Re: One last single bug, I hope - Zh3r0 - 23.06.2010

Quote:
Originally Posted by tour15
It looks weird dude! I cant think any other reason that happens
Filterscripts?
Check the OnPlayerDeath on the filterscripts you use.


Re: One last single bug, I hope - reallifescript - 23.06.2010

All filterscripts are off, I've double checked it

I think there is something else in my script wich bugs, but can't find it


Re: One last single bug, I hope - Vince - 23.06.2010

OnPlayerStateChange maybe? Or OnPlayerInteriorChange.
Could basically be anything that gets called when a player dies, other than OnPlayerDeath.


Re: One last single bug, I hope - reallifescript - 23.06.2010

public OnPlayerSave(playerid)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid])
{
new string3[32];
new pname3[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname3, sizeof(pname3));
format(string3, sizeof(string3), "%s.ini", pname3);
new File: pFile = fopen(string3, io_write);
if (pFile)
{
new var[32];
format(var, 32, "%s\n", PlayerInfo[playerid][pPassword]);fwrite(pFile, var);
fclose(pFile);
new File: hFile = fopen(string3, io_append);
PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);
format(var, 32, "Kills=%d\n",PlayerInfo[playerid][pKills]);fwrite(hFile, var);
format(var, 32, "Deaths=%d\n",PlayerInfo[playerid][pDeaths]);fwrite(hFile, var);
format(var, 32, "AdminLevel=%d\n",PlayerInfo[playerid][pAdmin]);fwrite(hFile, var);
format(var, 32, "FirstAidKit=%d\n",PlayerInfo[playerid][pMedicKit]);fwrite(hFile, var);
fclose(hFile);
}
}
}
return 1;
}

how about that?