help on: If(reason!=54)
#5

Quote:
Originally Posted by Koala818
Посмотреть сообщение
To detect if a player commits suicide, just check if there's no killer (killerid==INVALID_PLAYER_ID)
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(a51_haveMB[playerid] == 1) //if you have Money bag
    {
         if(killerid!=INVALID_PLAYER_ID) //if reason isn't sucicide
         {
             GivePlayerMoney(killerid, a51_MB_money);
             new str[128], name[MAX_PLAYER_NAME];
             GetPlayerName(playerid, name, sizeof(name));
             format(str, sizeof(str), "[AREA51]%s и STATO UCCISO! %s ha ora i soldi dell'area 51", name, killerid);
             SendClientMessageToAll(COLOR_RED, str);
         }
         else
         {
             new str[128], name[MAX_PLAYER_NAME];
             GetPlayerName(playerid, name, sizeof(name));
             format(str, sizeof(str), "[AREA51]%s и MORTO e ha perso i soldi dell'area 51", name);
             SendClientMessageToAll(COLOR_RED, str);
         }
         a51_haveMB[playerid] = 0;
         GivePlayerMoney(playerid, -a51_MB_money);
    }
    return 1;
}
thank you, i've add 1 rep to you
Reply


Messages In This Thread
help on: If(reason!=54) - by DarK_FeneR - 25.05.2014, 17:46
Re: help on: If(reason!=54) - by Koala818 - 25.05.2014, 17:50
Re: help on: If(reason!=54) - by Abagail - 25.05.2014, 17:50
Re: help on: If(reason!=54) - by MikE1990 - 25.05.2014, 17:51
Re: help on: If(reason!=54) - by DarK_FeneR - 25.05.2014, 17:57

Forum Jump:


Users browsing this thread: 1 Guest(s)