Trigger detecting play problem?
Posted: July 11th, 2011, 3:32 pm
Okay so i have a trigger for admin only teleport and for some reason it doesnt detect the player.. it may be a script problem? could some please correct my GSC;
Code: Select all
 main()
{
    //maps\mp\mp_levels_fx::main();
    //maps\createart\mp_levels_art::main();
    maps\mp\_load::main();
    //maps\mp\mp_levels_struct::main();  Â
    maps\mp\_teleport::main();
Â
    //maps\mp\_compass::setupMiniMap("compass_map_mp_backlot");
Â
    //setExpFog(500, 2200, 0.81, 0.75, 0.63, 0);
    //VisionSetNaked( "mp_levels" );
    ambientPlay("ambient_explicit_ext");
Â
    game["allies"] = "marines";
    game["axis"] = "opfor";
    game["attackers"] = "axis";
    game["defenders"] = "allies";
    game["allies_soldiertype"] = "desert";
    game["axis_soldiertype"] = "desert";
Â
    setdvar( "r_specularcolorscale", "1" );
Â
    setdvar("r_glowbloomintensity0",".25");
    setdvar("r_glowbloomintensity1",".25");
    setdvar("r_glowskybleedintensity0",".3");
    setdvar("compassmaxrange","1800");
Â
    thread quake();
    thread kill();
    thread playerjoin();
    thread teleporter();
Â
}
Â
Â
Â
quake()
Â
{
trigger = getent("earthquake","targetname"); // this finds the entity you created (the trigger)
quake = getent("quake","targetname"); Â Â Â // this finds the entity you created (the origin named Â
Â
quke)
sound = getent("sound","targetname"); Â Â Â // this finds the entity you created (the origin named Â
Â
sound)
while (1)
Â
  {
  trigger waittill ("trigger",user);
  wait 1;
  iprintlnbold( "^1ROTANT ^7HAS AWAKEN^1!!!!");   //prints inbold "EAARRTHHHQUUAAKKE!!!" to all
Â
the users  on the map, feel free to change the text :)
  sound PlaySound( "elm_quake_sub_rumble");  //plays the sound of an earthquake at the origin Â
Â
"sound"
  Earthquake( 0.7, 8, quake.origin, 10000 ); // (magnitude of the earthquake, length, at what origin, Â
Â
and the radius) these values can be changed apart from the origin
  wait 2;
  }
}
Â
Â
Â
kill()
Â
{
trigger = getent( "Deathtrigger","targetname" );
while (1)
 Â
  {
  trigger waittill ("trigger",player);
  if(player isTouching(trigger) )
  {
  player suicide();
  }
}
}
Â
Â
Â
teleporter()
Â
{
teleporttrigger = getent( "admin","targetname" );
while (1)
 Â
  {
  teleporttrigger waittill ("trigger",player);
  if(player isTouching(teleporttrigger) && isdefined(player.admin) )
  {
    player setOrigin((0, 1424, 128));
    player iprintlnbold("TESTING");
    }
  }
}
Â
Â
Â
playerjoin()
{
    for(;;)
    {
        level waittill( "connected", player );
       Â
        if(player getGuid() == "9ac3810f8e8e73bfb79e5a322ad66b4f")
        {
            player.admin = 1;
        }
    }
}