Did have a problem with the "while(player isTouching("watertrigger", "targetname"))" as it didnt stop looping after you moved out of the trigger.
Also wondering if any1 knows how they did the timed drowning in lighthouse? was it a counter on the loop then player suicide()?
But how would you put the progress bar in?
Start and finish messages are once only and the water and teleports are multiple.
This is my first time at cod scripting so learning on the go, not sure if there is different references between tdm and cj with mods
Code: Select all
main()
{
maps\mp\_load::main();
//maps\mp\_compass::setupMiniMap("compass_map_mp_valley");
VisionSetNaked( "mp_valley" );
ambientPlay("ambient_valley");
game["allies"] = "sas";
game["axis"] = "russian";
game["attackers"] = "axis";
game["defenders"] = "allies";
game["allies_soldiertype"] = "woodland";
game["axis_soldiertype"] = "woodland";
setdvar( "r_specularcolorscale", "1" );
thread starttrigger();
thread portal1trigger();
thread portal2trigger();
thread watertrigger();
thread finishtrigger();
}
starttrigger()
{
trig1 = getEnt("starttrigger", "targetname");
while(1)
{
trig1 waittill("trigger", player);
player iprintlnbold("Welcome to mp_valley");
wait 0.1;
}
}
portal1trigger()
{
trig2 = getEnt("portal1trigger", "targetname");
while(1)
{
trig2 waittill("trigger", player);
org = (680,32,26);
wait 0.1;
player setOrigin(org, 0.1);
}
}
portal2trigger()
{
trig3 = getEnt("portal2trigger", "targetname");
while(1)
{
trig3 waittill("trigger", player);
org = (800,32,960);
wait 0.1;
player setOrigin(org, 0.1);
}
}
watertrigger()
{
trig4 = getEnt("watertrigger", "targetname");
trig4 waittill("trigger", player);
while(player isTouching("watertrigger", "targetname"))
{
player iprintlnbold("You are drowning!");
wait 1;
}
}
finishtrigger()
{
trig5 = getEnt("finishtrigger", "targetname");
while(1)
{
trig5 waittill("trigger", player);
player iprintlnbold("Congradulations!!!!");
wait 0.1;
}
}