OnPlayerDeath
#9

pawn Код:
//==============================================================================
//OnPlayerDeath
//==============================================================================
public OnPlayerDeath(playerid, killerid, reason)
{
if(killerid == playerid) return 1; // They either fell, or took self-inflicted damage somehow.
new string[256];
format(string, sizeof(string), "You have killed %s.", GetName(playerid));
SendClientMessage(killerid, -1, string);
format(string, sizeof(string), "You have been killed by %s.", GetName(killerid));
SendClientMessage(killerid, -1, string);
return 1;
}

stock GetName(playerid)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    return name;
}
    //--------------------------------------------------------------------------
    //Settings & Others
    //--------------------------------------------------------------------------
    SetPlayerVirtualWorld(playerid, 0);
    SetPlayerWantedLevel(playerid, 0);
    SendDeathMessage(killerid, playerid, reason);
    if(killerid != INVALID_PLAYER_ID)
    {
        SetPlayerScore(killerid, GetPlayerScore(killerid) +1);
    }
    GivePlayerMoney(killerid, 100);
    GivePlayerMoney(playerid, 0);
    //--------------------------------------------------------------------------
    //Textdraw's Hide/Show
    //--------------------------------------------------------------------------
    TextDrawShowForPlayer(playerid, Textdraw27);
    //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    //TextDrawHideForPlayer(playerid, Textdraw0);
    //TextDrawHideForPlayer(playerid, Textdraw4);
    //TextDrawHideForPlayer(playerid, Textdraw5);
    TextDrawHideForPlayer(playerid, Textdraw6);
    TextDrawHideForPlayer(playerid, Textdraw7);
    TextDrawHideForPlayer(playerid, Textdraw8);
    TextDrawHideForPlayer(playerid, Textdraw81);
    TextDrawHideForPlayer(playerid, Textdraw82);
    TextDrawHideForPlayer(playerid, Textdraw83);
    TextDrawHideForPlayer(playerid, Textdraw84);
    //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    TextDrawHideForPlayer(playerid, TeleTD1);
    TextDrawHideForPlayer(playerid, TeleTD2);
    TextDrawHideForPlayer(playerid, TeleTD3);
Reply


Messages In This Thread
OnPlayerDeath - by Spartaaaaa - 19.05.2014, 19:00
Re: OnPlayerDeath - by JFF - 19.05.2014, 19:05
Re: OnPlayerDeath - by TakeiT - 19.05.2014, 19:05
Re: OnPlayerDeath - by Abagail - 19.05.2014, 19:13
Re : OnPlayerDeath - by yusei - 19.05.2014, 19:14
Re: OnPlayerDeath - by Spartaaaaa - 19.05.2014, 19:16
Re: OnPlayerDeath - by Abagail - 19.05.2014, 19:19
Re: OnPlayerDeath - by Spartaaaaa - 19.05.2014, 19:21
Re: OnPlayerDeath - by Spartaaaaa - 19.05.2014, 19:23
Re: OnPlayerDeath - by TakeiT - 19.05.2014, 19:28

Forum Jump:


Users browsing this thread: 1 Guest(s)