how i make /killall,/kickall,/banall ??
#1

the title say all...
Reply
#2

https://sampwiki.blast.hk/wiki/Keywords:Statements#for
Reply
#3

can u give an example?
Reply
#4

pawn Код:
for(new i=0; i < MAX_PLAYERS && i != playerid; i++)
{
       SetPlayerHealth(i,0.0);
}
Reply
#5

For example:
pawn Код:
CMD:killall(playerid, params[])
{
     for(new i = 0; i<MAX_PLAYERS; i++)
     {
          SetPlayerHealth(i, 0.0);
          SendClientMessage(playerid, -1, "All players have been killed.");
     }
     return 1;
}
Reply
#6

Example:

pawn Код:
command(banall,playerid, params[])
{
     if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,0xFFFFFFFF,"Not an admin...");
     for(new i = 0; i<MAX_PLAYERS; i++)
     {
          Ban(i);
     }
     return 1;
}
pawn Код:
command(kickall,playerid, params[])
{
     if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,0xFFFFFFFF,"Not an admin...");
     for(new i = 0; i<MAX_PLAYERS; i++)
     {
          Kick(i);
     }
     return 1;
}
pretty simple...
Reply
#7

another question...(on include)
how i make a line with message and colour??
(for example:: Say(playerid,message,colour); )
give an example!!!
Reply
#8

pawn Код:
SendClientMessage(playerid,0xFFFFFFFF,"Here's a message.");
You shouldent be making a /kickall /banall and shit if you dont even know sendclientmessage.
Reply
#9

-.-"
i mean how to make it in include....
for example:
pawn Код:
native Say(message,colour);

stock Say(message,colour)
{
somthing...
return 1;
}
i want to know how to make those to!! :: playerid(he need to enter playerid or just the word), value(value of cash/ammo and all...) and weaponid .
Reply
#10

Here.....
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)