
   /* AMX Mod script.
   *
   * (c) Copyright 2002-2003, f117bomb
   * This file is provided as is (no warranties).
   */
   #include <amxmod>
   #include <amxmisc>
   /*
   * amx_teleport <authid, nick, or #userid> [x] [y] [z]
   *  - Teleports to stored location or x y z
   *
   * amx_userorigin <authid, nick, or #userid>
   *  - Prints and Stores x y z of player
   *
   * Examples:
   *    amx_userorigin player - Stores Players location
   *    amx_teleport player2 - Teleport Player2 to Players location
   *    amx_teleport  player  100  120  500 - Teleports Player to 100 120
   500
   *
   */
   new storedorigin[3]
   public admin_teleport(id,level,cid) {
      if (!cmd_access(id,level,cid,2))
         return PLUGIN_HANDLED
      new arg[32], sx[8], sy[8], sz[8], origin[3], name2[32]
      new argc = read_argc()
      read_argv(1,arg,31)
      get_user_name(id,name2,31)
      if (argc > 2) {
         read_argv(2,sx,7)
         read_argv(3,sy,7)
         read_argv(4,sz,7)
         origin[0] = strtonum(sx)
         origin[1] = strtonum(sy)
         origin[2] = strtonum(sz)
      }
      else {
          origin = storedorigin
      }
      new player = cmd_target(id,arg,7)
      if (!player) return PLUGIN_HANDLED
      set_user_origin(player, origin)
      new name[32]
      get_user_name(player,name,31)
      switch(get_cvar_num("amx_show_activity"))    {
             case  2:    client_print(0,print_chat,"ADMIN  %s: teleported
   %s",name2,name)
             case    1:    client_print(0,print_chat,"ADMIN:   teleported
   %s",name)
      }
      console_print(id,"Client  ^"%s^"  has  been teleported to x:%i y:%i
   z%i",name,origin[0],origin[1],origin[2])
      return PLUGIN_HANDLED
   }
   public admin_userorigin(id,level,cid) {
      if (!cmd_access(id,level,cid,2))
         return PLUGIN_HANDLED
      new arg[32], origin[3]
      read_argv(1,arg,31)
      new player = cmd_target(id,arg,3)
      if (!player) return PLUGIN_HANDLED
      get_user_origin(player, origin)
      storedorigin = origin
      new name[32]
      get_user_name(player,name,31)
      console_print(id,"Client    ^"%s^"    origin,    x:%i    y:%i   z%i
   stored",name,origin[0],origin[1],origin[2])
      return PLUGIN_HANDLED
   }
   public plugin_init() {
      register_plugin("Admin Teleport","0.9.3","f117bomb")
      register_concmd("amx_teleport","admin_teleport",ADMIN_LEVEL_A,"<aut
   hid, nick, @team or #userid> [x] [y] [z]")
      register_concmd("amx_userorigin","admin_userorigin",ADMIN_LEVEL_A,"
   <authid, nick, or #userid>")
      return PLUGIN_CONTINUE
   }
