CMD:kill(playerid, params[]) { SetPlayerHealth(playerid, 0); return 1; }
i have this command
Код:
CMD:kill(playerid, params[]) { SetPlayerHealth(playerid, 0); return 1; } |
CMD:kill(playerid, params[])
{
new Float:min_distance = 10.0; // Minimum distance to disable this command
new Float:tmp, Float:ppos[3];
GetPlayerPos(playerid, ppos[0], ppos[1], ppos[2]);
for(new PlayerId = 0; PlayerId < MAX_PLAYERS; PlayerId++) {
if(PlayerId == playerid) continue;
if(IsPlayerInRangeOfPoint(playerid, min_distance, ppos[0], ppos[1], ppos[2])) {
SendClientMessage(playerid, -1, "You can't use this command, because there is someone nearby.");
return 1;
}
}
SetPlayerHealth(playerid, 0);
return 1;
}