Suicide
#1

how to make Suicide script?if player type /det = kill all player around him?
Reply
#2

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
Reply
#3

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.
Reply
#4

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.
Reply
#5

If you want the player to die with an explosion:
PHP код:
CMD:kill(playeridparams[])
{
   new 
Float:XFloat:YFloat:Z;
   
SetPlayerHealth(playerid0);
   
CreateExplosionForPlayer(playeridXYZ210.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(playeridCOLOR_BLUE"You have killed yourself!");
   return 
1;

Reply
#6

Does this works on players around it?
Reply
#7

PHP код:
CMD:det(playeridparams[])
{
    if(!
IsPlayerAdmin(playerid))
        return 
SendClientMessage(playerid, -1"Error: You are not authorized to use this command.");

    new 
Float:xFloat:yFloat:z;
    
GetPlayerPos(playeridxyz);

    for(new 
0MAX_PLAYERSI++)
    {
        if(!
IsPlayerConnected(I))
            continue;

        if(
== playerid)
            continue;

        if(
IsPlayerInRangeOfPoint(I15.0xyz))
            
SetPlayerHealth(I0);
    }

    return 
1;

Something like this. I did not test it, just wrote it in the message box. Don't know if it works.
Reply
#8

^^ This fella's got it.

Another thing though is that everybody is assuming he is able to, and is using, fast commands.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)