Player Suicide Command & Message[NEED HELP ++REP]
#5

Quote:
Originally Posted by Chausar
Посмотреть сообщение
help me with this. if i typed /kill i want the message appear to all player's left screen Example: Player 1 suicide ! so..what we need to put?

public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp("/kill", cmdtext, true))
{
SetPlayerHealth(playerid, 0);
return 1;
}
return 0;
}
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp("/kill", cmdtext, true))
    {
        new name[MAX_PLAYER_NAME], string[128];
        GetPlayerName(playerid, name, sizeof(name))
        SetPlayerHealth(playerid, 0);
        format(string, sizeof(string), "%s (%s) has committed {FF0000}suicide{FFFFFF}!", name, playerid);
        SendClientMessageToAll(0xC4C4C4FF, string);
        return 1;
    }
    return 0;
}
https://sampwiki.blast.hk/wiki/GetPlayerName
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)