Anyone help me with these commands
#7

kick all:
you were not checking if player id not i wrong and were not closing isplayerconnected it should be :

PHP код:
    else if(strcmp(cmdtext"/kickall"true) == 0)
    {
        if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1"You need to be rcon admin use /rcon login {pass}");
          for(new 
0MAX_PLAYERSi++)
           {
           if(
IsPlayerConnected(i) && != playerid)
            {
            
PlayerPlaySound(i,1057,0.0,0.0,0.0);
            
Kick(i);
           }
         }
        new 
string[128],pname[MAX_PLAYER_NAME+1]; GetPlayerName(playerid,pname,sizeof pname);
        
format(string,sizeof(string),"[ Administrator \"%s\" has Kicked all players. ]",pname);
        
SendClientMessageToAll(COLOR_LIGHTBLUE,string);
        return 
1;
    } 
kill all same as above you did not close isplayerconnected and you did not load player id not [ i] well, spam messages on chat cause you send a client message in a loop you should close the loop and send your message like below:

PHP код:
    else if(strcmp(cmdtext"/killall"true) == 0)
    {
        if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1"You need to be rcon admin use /rcon login {pass}");
         for(new 
0MAX_PLAYERSi++)
          {
              if(
IsPlayerConnected(i) && != playerid) { SetPlayerHealth(i0); }
          }
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"You have killed all players");
           return 
1;
   } 
get all:
you did not check isplayerconnected well and you did not send message to all players you just made a format also you did not open isplayerconnected + i not player id you just closed it by : }
here we go this should work:

PHP код:
    else if(strcmp(cmdtext"/getall"true) == 0)
    {
        if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1"You need to be rcon admin use /rcon login {pass}");
        new 
Float:x,Float:y,Float:zinterior GetPlayerInterior(playerid);
        
GetPlayerPos(playerid,x,y,z);
        for(new 
0MAX_PLAYERSi++)
            {
                if(
IsPlayerConnected(i)) && != playerid) {
                
PlayerPlaySound(i,1057,0.0,0.0,0.0);
                
SetPlayerPos(i,x+(playerid/4)+1,y+(playerid/4),z);
                
SetPlayerInterior(i,interior);
            }
          }
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"You have got all players to your self");
        new 
string[128],pname[MAX_PLAYER_NAME+1]; GetPlayerName(playerid,pname,sizeof pname);
        
format(string,sizeof(string)," Administrator \"%s\" has Teleported all players.",pname);
        
SendClientMessageToAll(COLOR_LIGHTBLUE,string);
        return 
1;
    } 
Reply


Messages In This Thread
Anyone help me with these commands - by Beasthian - 29.11.2015, 08:49
Re: Anyone help me with these commands - by xTURBOx - 29.11.2015, 13:40
Re: Anyone help me with these commands - by UltraScripter - 29.11.2015, 14:00
Re: Anyone help me with these commands - by Pottus - 29.11.2015, 14:09
Re: Anyone help me with these commands - by UltraScripter - 29.11.2015, 14:13
Re: Anyone help me with these commands - by Vince - 29.11.2015, 14:30
Re: Anyone help me with these commands - by jlalt - 29.11.2015, 14:30
Re: Anyone help me with these commands - by Beasthian - 30.11.2015, 07:29

Forum Jump:


Users browsing this thread: 1 Guest(s)