Liberty Unleashed

Scripting => Script Help => Topic started by: matheo on June 11, 2012, 12:07:46 pm

Title: help me with this
Post by: matheo on June 11, 2012, 12:07:46 pm
Hello , who can write for me one thing

1.

If i press command "startbase and number base" class team 1 and 2 (or skin 22/23) teleport to x,y,z . and automatic get ak74 and uzi.

and If i press startarena class team 1 and 2(skin 22/23) teleport to this positions for simple:

I press "startbase 12" so
Skin 22 (class1) teleport x="899.7" y="-442.9" z="19.37"
Skin 23 (class2) teleport x="891.7" y="-434.6" z="19.37"

and they get automatic ak74

2.Commands to remove all cars on server if they spawned

Thanks for reading , sorry for english
Title: Re: help me with this
Post by: Rocky on June 11, 2012, 12:35:33 pm
Code: [Select]
else if(cmd == "startbase")
{
  if(!text) MessagePlayer("/startbase <id>",player);
  else
  {
    if(text.tointeger() == 12)
    {
       while(local i < GetMaxPlayers()+1)
      {
       if(FindPlayer(i))
       {
         if(FindPlayer(i).Class == 0)
         {
             FindPlayer(i).Skin = 22;
             player.Pos = Vector(899.7,-442.9,19.37);
             FindPlayer(i).SetWeapon(5,100000000);
             FindPlayer(i).SetWeapon(3,100000000);
         }
         if(FindPlayer(i).Class == 1)
         {
            FindPlayer(i).Skin = 22;
            FindPlayer(i).Pos = Vector(891.7,-434.6,19.37);
            FindPlayer(i).SetWeapon(5,100000000);
            FindPlayer(i).SetWeapon(3,100000000);
         }
        }
       i++;
       }
   }
  else MessagePlayer("only base id 12 is loaded :/",player);
}
}
           

Code: [Select]
else if(cmd == "remallveh")
{
   local i = 0;
   while(i < GetVehicleCount()+1)
   {
     if(FindVehicle(i))
     {
         FindVehicle(i).Remove();
     }
    i++;
   }
}

Not tested or anything
Title: Re: help me with this
Post by: matheo on June 11, 2012, 01:31:59 pm
line 1
column 4
error :)
Title: Re: help me with this
Post by: VetalYA on June 11, 2012, 01:57:30 pm
line 1
column 4
error :)

Dont use else   if this is a first command (onPlayerCommand event).
Title: Re: help me with this
Post by: Rocky on June 11, 2012, 03:40:34 pm
Thought you were making from a released script so i used else if or you could use switch too (Vortrex idea)