Page 1 of 1

script keeps repeating

Posted: Sun Oct 25, 2009 2:07 am
by Tazz
Ok guys i modded a section of map for bash only......whenu spawn in u only have the pistol but then it keeps taking and giving it back every couple seconds....heres the script im using for the weapons...i need a way to just do this once i had it working before and it works on our server but dont haver original script.....thanx guys

Code: Select all

pistol:

while(1)
{
$player take models/weapons/colt45.tik
$player take models/weapons/p38.tik // axis pistol
$player give models/weapons/silencedpistol.tik // allied pistol
$player useweaponclass pistol
$player take models/weapons/kar98sniper.tik // axis sniper rifle
$player take models/weapons/kar98.tik // axis rifle
$player take models/weapons/mp40.tik // axis sub-machine gun
$player take models/weapons/mp44.tik // axis machine gun
$player take models/weapons/panzerschreck.tik // axis rocket launcher
$player take models/weapons/springfield.tik // allied sniper rifle
$player take models/weapons/bar.tik // allied rifle
$player take models/weapons/thompsonsmg.tik // allied sub-machine gun
$player take models/weapons/m1_garand.tik // allied machine gun
$player take models/weapons/m2frag_grenade.tik //allied nade
$player take models/weapons/m2frag_grenade_sp.tik //allied nade
$player take models/weapons/m2frag_grenade_sp_start.tik //goes with allied nade
$player take models/weapons/steilhandgranate.tik //german nade
$player take models/weapons/steilhandgranate_start.tik //goes with german nade
$player take models/weapons/bazooka.tik // allied rocket launcher
$player take models/weapons/shotgun.tik // shotgun
wait 1
}

end

Re: script keeps repeating

Posted: Sun Oct 25, 2009 8:47 pm
by SA007
Try this

Code: Select all

pistol:

while(1)
{
      for (local.p=1;local.p<=$player.size;local.p++)
      {
         local.player = $player[local.p]
         if (local.player.taken != 1) {
           local.player takeall
           local.player give models/weapons/silencedpistol.tik // allied pistol
           waitframe
           local.player useweaponclass pistol
           local.player.taken = 1
         }
      }
      wait 1
}

end
[/quote]

Posted: Sat Oct 31, 2009 3:51 am
by Tazz
thanx alot man but i got it working lol....the script is fine it was repeating on my machine but doesnt on the server...i dont get it but t working nonetheless....thanx again