!!! NOTE !!! Built in into AWE, readme included for cvar descriptions. /Bell Ravir's little admin tools written by Clifton Cline, a.k.a. [FLARE]_Ravir ravir@clan-flare.org http://www.clan-flare.org ------------------------------------------------------- Description: Little useful tools for admin ------------------------------------------------------- Tools list: "g_switchteam" This is a variable that acts as a command to force a player to switch teams. Use "status" (or for remote access, "rcon status") to get the client ID number of the player, then use console to set this variable to their ID. Example: \set g_switchteam 3 This will cause the player number 3 to switch sides. NOTE: Setting g_switchteam to -1 will cause ALL players to switch sides... very useful for matches. "g_killum" This kills a player by their ID. Good for sadistic admins. Example: \set g_killum 3 This will cause the player number 3 to suicide. substr(searchfor, searchin) This function returns the location of "searchfor" in the "searchin" string. Returns -1 if not found. Add the following function to any existing gameplay script to make referencing it in code easier: substr(searchfor, searchin) { return maps\mp\gametypes\user_Ravir_admin::substr(searchfor, searchin); } "g_kicktospec" Kicks a player to spectator mode (removes them from a team). NOTE FOR AWE: g_kicktospec only available in dem and mc_dem. /Bell NOTE: Setting g_switchteam to -1 will cause ALL players to spectate. Also very useful for matches. ANOTHER NOTE: Because of the dependency on other functions in the gametype, this thread is actually included in the override gametypes and is not stored in the admin script. Therefore, to use it, you'll either have to use my gametype overrides, or copy the "kicktospec()" function into whatever other mod you have with gametype overrides. ------------------------------------------------------- Installation: Put the "user_Ravir_admin.pk3" file in the Main directory. IF you have other mods that override the standard gametype scripts, use "user_Ravir_admin_nogame.pk3" instead, and edit your mods and insert these as the last lines in the "main()" function: thread maps\mp\gametypes\user_Ravir_admin::main(); thread kicktospec(); and paste this function at the very end of the gametype script: ///////////////////////// begin kicktospec function kicktospec() { self notify("boot"); self endon("boot"); setcvar("g_kicktospec", ""); while(1) { if(getcvar("g_kicktospec") != "") { specPlayerNum = getcvarint("g_kicktospec"); players = getentarray("player", "classname"); for(i = 0; i < players.size; i++) { thisPlayerNum = players[i] getEntityNumber(); if(thisPlayerNum == specPlayerNum || specPlayerNum == -1) // this is the one we're looking for { players[i].pers["team"] = "spectator"; players[i].sessionteam = "spectator"; players[i] setClientCvar("g_scriptMainMenu", game["menu_team"]); players[i] setClientCvar("scr_showweapontab", "0"); players[i] thread spawnSpectator(); if(specPlayerNum != -1) iprintln(players[i].name + "^7 was forced into spectator mode by the admin"); } } if(specPlayerNum == -1) iprintln("The admin forced all players to switch teams."); setcvar("g_kicktospec", ""); } wait 0.05; } } ///////////////////////// end kicktospec function