Page 1 of 1
Admin ONLY teleporter
Posted: July 11th, 2011, 12:59 pm
by Reality
Is there a way i can put a normal teleporter on my map, but only the server admins can use and be teleport so if a normal and VIP player stand on it nothing happens and doesnt teleport them
Re: Admin ONLY teleporter
Posted: July 11th, 2011, 1:20 pm
by F |Madness| U
Code: Select all
onPlayerConnect()
{
for(;;)
{
level waittill( "connected", player );
if(player getGuid() == "34729847392874923")
{
player.admin = 1;
}
}
}
triggerstuff()
{
........
while(1)
{
trigger waittill("trigger", player);
if(isdefined(player.admin))
{
//do teleport
}
}
}
Think something like that should work, but I@m not completely sure cause I'm a noob.
Re: Admin ONLY teleporter
Posted: July 11th, 2011, 1:29 pm
by Reality
Okay thankyou, im a big noob so where do i need to add this.. in my GSC?
if so, where abouts..
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 kill();
thread quake();
}
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( "EAARRTHHHQUUAAKKE!!!"); //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()
{
your_trigger_name = getent( "trigger","targetname" );
while (1)
{
trigger waittill ("trigger",player);
player suicide();
}
}
Re: Admin ONLY teleporter
Posted: July 11th, 2011, 3:07 pm
by Rich
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 kill();
    thread quake();
    thread admintell();
Â
}
Â
Â
Â
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( "EAARRTHHHQUUAAKKE!!!");   //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()
Â
{ Â
Â
your_trigger_name = getent( "trigger","targetname" );
Â
  while (1)
Â
  {
Â
   trigger waittill ("trigger",player);
Â
       player suicide();
Â
   }
Â
 }
Â
admintell()
{
trig = getent("admintrig","targetname");
Â
while(true)
  {
     trig waittill("trigger", player);
     if(player.cj["status"] == 2)
     {
      player setOrigin((0, 0, 0));//set the origin of where to port to
     }
     wait 1;
    }
Â
}
Â
set the origin (you can get it from radiant of using /viewpos) then make a trigger_multiple with the key: targetname and value: admintrig