SA-MP Forums Archive
onplayerdeath problem - 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 problem (/showthread.php?tid=627565)



onplayerdeath problem - Mijata - 29.01.2017

Why player who got killed or player who used cmd /kill lose 100$


Re: onplayerdeath problem - saffierr - 29.01.2017

That's a default thingy by SAMP.
You can give the player 100 dollar back to prefent it.


Re: onplayerdeath problem - haikalbintang - 30.01.2017

You can use server side money like this :

PHP код:
#define GivePlayerCash(%0,%1) SetPVarInt(%0,"Money",GetPlayerCash(%0)+%1),GivePlayerMoney(%0,%1)
#define ResetPlayerCash(%0) SetPVarInt(%0,"Money",0), ResetPlayerMoney(%0)
#define GetPlayerCash(%0) GetPVarInt(%0,"Money")
public OnGameModeInit()
{
 
SetTimer("MoneyUpdate",1000,1);
}
stock MoneyUpdate(playerid)
{
    if(
GetPlayerCash(playerid) < GetPlayerMoney(playerid))
    {
        foreach(
Playeri)
        {
              new const 
old_money GetPlayerCash(playerid);
            
ResetPlayerCash(playerid), GivePlayerCash(playeridold_money);
           }
    }
     return 
1;

Don't forget to change the Money to Cash.