droffy....
Moderator: Core Staff
-
- Core Staff
- Posts: 13315
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
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");
}
}
-
- Core Staff
- Posts: 13315
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
-
- Core Staff
- Posts: 13315
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
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...
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");
}

Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
-
- Core Staff
- Posts: 13315
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
everytime...Soviet wrote:will this effect occur every time the person walks over the trigger multiple, or only when they spawn?
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");
}
}

Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
-
- CJ Worshipper
- Posts: 383
- Joined: December 16th, 2005, 6:38 pm
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");
}
}
-
- Core Staff
- Posts: 13315
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
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)
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");
}
}

Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
-
- CJ Worshipper
- Posts: 383
- Joined: December 16th, 2005, 6:38 pm
Who is online
Users browsing this forum: No registered users and 3 guests