25.09.2010, 16:12
Try this one (Put it inside OnPlayerCommandText):
[Is a simple kill command, you can add more functions to make it as you want to be.]
[Is a simple kill command, you can add more functions to make it as you want to be.]
pawn Код:
new
index,
cmd[20];
cmd = strtok(cmdtext, index);
if (strcmp(cmd, "/kill", true) == 0)
{
new
tmp[20],
id;
tmp = strtok(cmdtext, index);
if (strlen(tmp))
{
id = strval(tmp);
if (IsPlayerConnected(id))
{
SetPlayerHealth(id, 0);
SendClientMessage(playerid, 0x00FF00AA, "Player killed");
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "Player not found");
}
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/kill <playerid>\"");
}
return 1;
}