SA-MP Forums Archive
OnPlayerDeath bug - 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: OnPlayerDeath bug (/showthread.php?tid=570655)



OnPlayerDeath bug - TaiChi - 12.04.2015

Hey guys i have Problem in OnPlayerdeath when i die all my Money Go to restart and go to 0$

Please help me
Full OnPlayerDeath
http://pastebin.com/CK4nmCdn


Re: OnPlayerDeath bug - Misiur - 12.04.2015

pawn Код:
//(...)
     ResetPlayerMoneyEx(playerid);
     #undef killerid
     #undef reason
     return 1;
}
Quite certain ResetPlayerMoneyEx causes it.


Re: OnPlayerDeath bug - ATGOggy - 12.04.2015

There are a lot of custom function and no one's going to read it.
Anyway, show the code of the function GivePlayerMoneyEx.


Re: OnPlayerDeath bug - Abagail - 12.04.2015

You loose $100 upon death as you do in singleplayer:
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
      GivePlayerMoney(playerid, 100);
      return 1;
}
Source: http://forum.sa-mp.com/showpost.php?...83&postcount=3


Re: OnPlayerDeath bug - ATGOggy - 12.04.2015

Quote:
Originally Posted by Abagail
Посмотреть сообщение
You loose $100 upon death as you do in singleplayer:
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
      GivePlayerMoney(playerid, 100);
      return 1;
}
Source: http://forum.sa-mp.com/showpost.php?...83&postcount=3
He says his money is reset.


Re: OnPlayerDeath bug - TaiChi - 12.04.2015

PHP код:
stock ResetPlayerMoneyEx(playerid)
{
    if(
IsValidPlayer(playerid))
    {
        
PlayerInfo[pMoney][playerid]=0;
        return 
ResetPlayerMoney(playerid);
    }
    return 
0;
}
stock GetPlayerMoneyEx(playerid)
{
    if(
IsValidPlayer(playerid))
    {
        new 
money=GetPlayerMoney(playerid);
         if(
money<PlayerInfo[pMoney][playerid] || !ServerVariables[ANTI_MONEYHACK])
              return 
money;
        return 
PlayerInfo[pMoney][playerid];
    }
    return 
0;




Re: OnPlayerDeath bug - TaiChi - 13.04.2015

Bump!


Re: OnPlayerDeath bug - TaiChi - 15.04.2015

Bump!