Suicide -
GeneralAref - 12.12.2015
how to make Suicide script?if player type /det = kill all player around him?
Re: Suicide -
Sew_Sumi - 12.12.2015
SetPlayerHealth would help you in this quest... A for loop to go through all players, and check how far they are from the point of the person who did the command.
https://sampforum.blast.hk/showthread.php?tid=4
https://sampforum.blast.hk/showthread.php?tid=30938
https://sampforum.blast.hk/showthread.php?tid=447813
Re: Suicide -
GeneralAref - 12.12.2015
i found this
Код:
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;
}
But too late it for kill player.
Re: Suicide -
Ritzy2K - 12.12.2015
Sorry for any mistake, I'm typing through my phone.
First of all, I think you want player to suicide bomb? Or something like that.
Well. Look for players in the range around him. And set their health to 0, you can make an explosion to make it look better.
Or, if u just want the player to die who uses /kill, just set his health to 0.. I'd write it for you but I'm from phone :3
Cheers.
Re: Suicide -
saffierr - 12.12.2015
If you want the player to die with an explosion:
PHP код:
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;
}
Re: Suicide -
GeneralAref - 13.12.2015
Does this works on players around it?
Re: Suicide -
Denying - 13.12.2015
PHP код:
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;
}
Something like this. I did not test it, just wrote it in the message box. Don't know if it works.
Re: Suicide -
Sew_Sumi - 13.12.2015
^^ This fella's got it.
Another thing though is that everybody is assuming he is able to, and is using, fast commands.