I need help with a command, to teleport 5 players
#1

I am making an arena in which the command is / arena and is as follows:

one player makes the command and is waiting, and when a player 5 makes this command, all five will be teleported to the arena. But something is wrong and only the 5th player is teleported

The code

pawn Код:
if(strcmp(cmd, "/arena", true) == 0) {
   if (gPublicEnemy == playerid){
   SendClientMessage(playerid, COLOR_GRAD1, " ");
   return 1;
   }
   new interior = PlayerInfo[playerid][pInt];
   new location = PlayerInfo[playerid][pLocal];
   if(location < 255)
   {
   //SendClientMessage(playerid, COLOR_RED,"");
   return 1;
   }
   if(interior == 6)//Interior(6) Jail
   {
   SendClientMessage(playerid, COLOR_RED," You are in jail");
   return 1;
   }
   if(vfightpl[playerid] == 1)
   {
   SendClientMessage(playerid, COLOR_RED," You are in stand by");
   return 1;
   }
   if(vfight == 0)
   {
   vfight = 1;
   vfightpl[playerid] = 1;
   antiheal[playerid]=1;
   return 1;
   }
   if(vfight == 1)
   {
   vfight = 2;
   vfightpl[playerid] = 2;
   return 1;
   }
   if(vfight == 2)
   {
   vfight = 3;
   vfightpl[playerid] = 3;
   return 1;
   }
   if(vfight == 3)
   {
   vfight = 4;
   vfightpl[playerid] = 4;
   return 1;
   }
   if(vfight == 4)
   {
   vfight = 5;
   vfightpl[playerid] = 5;
   
   for(new i = 0; i < MAX_PLAYERS; i++)
            {
            if(IsPlayerConnected(i))
            {
            if(vfightpl[i] == 1)
            {
            SetPlayerPos(playerid,55.7527,2602.4304,16.4844);
            SetPlayerFacingAngle(playerid,200.1634);
            GivePlayerWeapon(playerid, 4, 1);
            GivePlayerWeapon(playerid, 27, 1000000);
            GivePlayerWeapon(playerid, 29, 1000000);
            GivePlayerWeapon(playerid, 30, 1000000);
            GivePlayerWeapon(playerid, 34, 1000000);
            GivePlayerWeapon(playerid, 24, 1000000);
            }
           
            if(vfightpl[i] == 2)
            {
            SetPlayerPos(playerid,159.5226,2446.6265,16.4725);
            SetPlayerFacingAngle(playerid,354.4381);
            GivePlayerWeapon(playerid, 4, 1);
            GivePlayerWeapon(playerid, 27, 1000000);
            GivePlayerWeapon(playerid, 29, 1000000);
            GivePlayerWeapon(playerid, 30, 1000000);
            GivePlayerWeapon(playerid, 34, 1000000);
            GivePlayerWeapon(playerid, 24, 1000000);
            }
           
            if(vfightpl[i] == 3)
            {
            SetPlayerPos(playerid,359.5411,2542.7529,16.6590);
            SetPlayerFacingAngle(playerid,156.3893);
            GivePlayerWeapon(playerid, 4, 1);
            GivePlayerWeapon(playerid, 27, 1000000);
            GivePlayerWeapon(playerid, 29, 1000000);
            GivePlayerWeapon(playerid, 30, 1000000);
            GivePlayerWeapon(playerid, 34, 1000000);
            GivePlayerWeapon(playerid, 24, 1000000);
            }
           
            if(vfightpl[i] == 4)
            {
            SetPlayerPos(playerid,470.8924,2467.8413,24.9349);
            SetPlayerFacingAngle(playerid,55.1191);
            GivePlayerWeapon(playerid, 4, 1);
            GivePlayerWeapon(playerid, 27, 1000000);
            GivePlayerWeapon(playerid, 29, 1000000);
            GivePlayerWeapon(playerid, 30, 1000000);
            GivePlayerWeapon(playerid, 34, 1000000);
            GivePlayerWeapon(playerid, 24, 1000000);
            }
           
            if(vfightpl[i] == 5)
            {
            SetPlayerPos(playerid,406.0203,2448.7781,16.5000);
            SetPlayerFacingAngle(playerid,2.7700);
            GivePlayerWeapon(playerid, 4, 1);
            GivePlayerWeapon(playerid, 27, 1000000);
            GivePlayerWeapon(playerid, 29, 1000000);
            GivePlayerWeapon(playerid, 30, 1000000);
            GivePlayerWeapon(playerid, 34, 1000000);
            GivePlayerWeapon(playerid, 24, 1000000);
            }
           
            }
            }
           
           

   return 1;
   }
   return 1;
}
I have more things but i think the error is there
Reply


Messages In This Thread
I need help with a command, to teleport 5 players - by jonybomb - 10.07.2010, 11:38
Re: I need help with a command, to teleport 5 players - by Grim_ - 11.07.2010, 10:33
Re: I need help with a command, to teleport 5 players - by jonybomb - 11.07.2010, 20:43
Re: I need help with a command, to teleport 5 players - by oliverrud - 11.07.2010, 20:45
Re: I need help with a command, to teleport 5 players - by jonybomb - 12.07.2010, 20:59
Re: I need help with a command, to teleport 5 players - by -Rebel Son- - 13.07.2010, 02:19

Forum Jump:


Users browsing this thread: 2 Guest(s)