onplayerdeath problem
#1

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

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

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)