#1

Hi, I am new in scripting and I would like if somebody could tell me how to make a command to kill all players except player that wrote the command.
Thank you.
Reply
#2

try this (untested) :
pawn Код:
CMD:killall(playerid,params[])
{
for(new i=0; i != playerid; i++ )
{
SetPlayerHealth(i,0.0);
}
return 1;
}
Reply
#3

It doesn't kill anybody. Just nothing happens.
Reply
#4

CMD:killall(playerid,params[])
{
for(new i-0; i++; && != playerid; )
{
SetPlayerHealth(i,0);
}
return 1;
}

Just a guess, I havent scripted in 2 months lol
Reply
#5

try also :
pawn Код:
CMD:killall(playerid,params[])
{
for(new i=0; i < MAX_PLAYERS && i != playerid; i++ )
{
SetPlayerHealth(i,0.0);
}
return 1;
}
Reply
#6

Now nobody dies.

Is there anyone who is 100% sure about this?
Reply
#7

CMD:killall(playerid,params[])
{
for(new i=0; i < MAX_PLAYERS; i++ )
{
if(i != playerid) SetPlayerHealth(i,0.0);
}
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)