12.12.2015, 16:08
how to make Suicide script?if player type /det = kill all player around him?
CMD:detme(playerid, params[]) { new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); CreateExplosion(x, y, z, 3, 10.0); return 1; }
CMD:kill(playerid, params[])
{
new Float:X, Float:Y, Float:Z;
SetPlayerHealth(playerid, 0);
CreateExplosionForPlayer(playerid, X, Y, Z, 2, 10.0); // Reason of using CreateExplosionForPlayer instead of CreateExplosion is simply because the damage will be only for the player instead of everyone around him.
SendClientMessage(playerid, COLOR_BLUE, "You have killed yourself!");
return 1;
}
CMD:det(playerid, params[])
{
if(!IsPlayerAdmin(playerid))
return SendClientMessage(playerid, -1, "Error: You are not authorized to use this command.");
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
for(new I = 0; I < MAX_PLAYERS; I++)
{
if(!IsPlayerConnected(I))
continue;
if(I == playerid)
continue;
if(IsPlayerInRangeOfPoint(I, 15.0, x, y, z))
SetPlayerHealth(I, 0);
}
return 1;
}