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

Use GetPlayerName and fomat the message, then send it.
pawn Код:
new Name[MAX_PLAYER_NAME], string[20 + MAX_PLAYER_NAME];
// Declares 2 arrays, "Name" and "string"

GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
// Stores the players name in the "Name" array as a string

format(string, siezeof(string), "%s has killed himself.", Name);
// Formats "string" to contain the message above, where %s will be "Name"

SendClientMessageToAll(-1, string);
// Sends the message "string" contains
https://sampwiki.blast.hk/wiki/GetPlayerName
https://sampwiki.blast.hk/wiki/Format

EDIT: @JaydenJason, playerid is an integer, not a string.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)