Page 2 of 2

Posted: October 2nd, 2006, 11:45 am
by Drofder2004
post up your full gsc please.

Posted: October 2nd, 2006, 5:49 pm
by Soviet

Code: Select all

main()
{
maps\mp\_load::main();
thread onConnect();

ambientPlay("ambient_france");
}

OnConnect()
{
   for(;;)
   {
      level waittill("connected", self); 
      self thread onPlayerSpawned();
   }
}

onPlayerSpawned()
{
   for(;;)
   {
      self waittill("spawned_player");
      self takeAllWeapons();
      self giveWeapon("kar98k_mp");
      self switchToWeapon("kar98k_mp");
   }
}

Posted: October 2nd, 2006, 6:22 pm
by Drofder2004
I am guessing the error comes from the fact this is CoD not CoD2.
I will check to find an alternative for vCoD.

Posted: October 2nd, 2006, 6:28 pm
by Drofder2004
I am guessing the error comes from the fact this is CoD not CoD2.
I will check to find an alternative for vCoD.

---

Ok, CoD does not use the 'improved' waiting scripts, so this is a work around.

underneath the spawn points make a trigger multiple.
Then a slight change of code...

Code: Select all

main()
{
maps\mp\_load::main();
thread onSpawn();

ambientPlay("ambient_france");
}

onSpawn()
{
   trig = getent("trig","targetname");

   for(;;)
   {
      trig waittill("trigger", other); 
      other thread onPlayerSpawned();
   }
}

onPlayerSpawned()
{
      self takeAllWeapons();
      self giveWeapon("kar98k_mp");
      self switchToWeapon("kar98k_mp");
}

Posted: October 2nd, 2006, 8:10 pm
by Soviet
will this effect occur every time the person walks over the trigger multiple, or only when they spawn?

Posted: October 2nd, 2006, 8:53 pm
by Drofder2004
Soviet wrote:will this effect occur every time the person walks over the trigger multiple, or only when they spawn?
everytime...
to stop it from happening you need to use some checks...

Code: Select all

onPlayerSpawned()
{
      weapon = self getWeaponSlotWeapon("primary");
      if(weapon != "kar98k_mp")
      {
            self takeAllWeapons();
            self giveWeapon("kar98k_mp");
            self switchToWeapon("kar98k_mp");
      }
}

Posted: October 26th, 2006, 9:40 am
by All-Killer
Hmm i got the same error as soviet and im using cod2. This is my script:

Code: Select all

main()
{
maps\mp\_load::main();

thread billboard();
thread onConnect();

setExpFog(0.0001, 0.55, 0.6, 0.55, 0);
// setCullFog(0, 16500, 0.55, 0.6, 0.55, 0);
ambientPlay("ambient_france");

game["allies"] = "american";
game["axis"] = "german";
game["attackers"] = "allies";
game["defenders"] = "axis";
game["american_soldiertype"] = "normandy";
game["german_soldiertype"] = "normandy";

setCvar("r_glowbloomintensity0", ".25");
setCvar("r_glowbloomintensity1", ".25");
setcvar("r_glowskybleedintensity0",".3");

}

billboard()
{
spin = getent("billboard","targetname");
while (1)
{

spin rotateyaw(-360, 5);

spin waittill("rotatedone");
}
}


OnConnect()
{
   for(;;)
   {
      level waittill("connected", self);
      self thread onPlayerSpawned();
   }
}

onPlayerSpawned()
{
   for(;;)
   {
      self waittill("spawned_player");
      self takeAllWeapons();
      self giveWeapon("kar98k_mp");
      self switchToWeapon("kar98k_mp");
   }
}

Posted: October 27th, 2006, 1:50 pm
by Drofder2004
Sorry, I completely fucked up this code by using a "keyword" (self). you can only use self if self is defined before the thread is run...

Basically, if you dont understand... dont worry, just use this code (tested)

Code: Select all

main()
{
maps\mp\_load::main();
thread onConnect();
}

onConnect()
{
   for(;;)
   {
      level waittill("connected", other);
      other thread onPlayerSpawned();
   }
}

onPlayerSpawned()
{
   for(;;)
   {
      self waittill("spawned_player");
      wait 0.5;
      self takeAllWeapons();
      self giveWeapon("kar98k_mp");
      self switchToWeapon("kar98k_mp");
   }
}

Posted: October 27th, 2006, 7:38 pm
by All-Killer
Oke works perfectly now the only thing i still need is the strate time please help me with this.