08.07.2009, 13:21
This is an example:
pawn Код:
dcmd_kill(playerid, params[])
{
new player2 = strval(params);
new params1[256], index;
params1 = strtok(params, index);
if(!strlen(params))
{
SendClientMessage(playerid,COLOR_RED,"Usage: /kill [playerid]");
return 1;
}
if(!IsPlayerConnected(player2))
{
SendClientMessage(playerid,0xFFFFFFAA,"Error: Player is not connected");
return 1;
}
new playername[MAX_PLAYER_NAME], playername2[MAX_PLAYER_NAME], string[256];
GetPlayerName(player2, playername, sizeof(playernamename));
GetPlayerName(playerid, playername2, sizeof(playername2));
format(string, sizeof(string), "%s has killed %s", playername2, playername);
SendClientMessageToAll(0xFF000AA, string);
SetPlayerHealth(player2, 0);
return 1;
}