//////////////////////////////////////////////////////////////////////////////////// // SVR Mod, for CoD Support site: http://aigaming.net | number_07@hotmail.com // //////////////////////////////////////////////////////////////////////////////////// #include maps\mp\gametypes\_dev; // ADMINS: Be very careful when editing this file, as the server may crash! initMaps() { // This section is for the SVR SE admin menu, not for the standard mod. // Do not change anything but the quoted text at the end of each line. // Maximum maps available: 26 game["svrAmCm"]["name1"]= "Custom 1" ; // example: "Cool Map" game["svrAmCm"]["map1"]= "" ; // example: "mp_coolmap" game["svrAmCm"]["name2"]= "Custom 2" ; game["svrAmCm"]["map2"]= "" ; game["svrAmCm"]["name3"]= "Custom 3" ; game["svrAmCm"]["map3"]= "" ; game["svrAmCm"]["name4"]= "Custom 4" ; game["svrAmCm"]["map4"]= "" ; game["svrAmCm"]["name5"]= "Custom 5" ; game["svrAmCm"]["map5"]= "" ; game["svrAmCm"]["name6"]= "Custom 6" ; game["svrAmCm"]["map6"]= "" ; game["svrAmCm"]["name7"]= "Custom 7" ; game["svrAmCm"]["map7"]= "" ; game["svrAmCm"]["name8"]= "Custom 8" ; game["svrAmCm"]["map8"]= "" ; game["svrAmCm"]["name9"]= "Custom 9" ; game["svrAmCm"]["map9"]= "" ; game["svrAmCm"]["name10"]= "Custom 10" ; game["svrAmCm"]["map10"]= "" ; game["svrAmCm"]["name11"]= "Custom 11" ; game["svrAmCm"]["map11"]= "" ; game["svrAmCm"]["name12"]= "Custom 12" ; game["svrAmCm"]["map12"]= "" ; game["svrAmCm"]["name13"]= "Custom 13" ; game["svrAmCm"]["map13"]= "" ; game["svrAmCm"]["name14"]= "Custom 14" ; game["svrAmCm"]["map14"]= "" ; game["svrAmCm"]["name15"]= "Custom 15" ; game["svrAmCm"]["map15"]= "" ; game["svrAmCm"]["name16"]= "Custom 16" ; game["svrAmCm"]["map16"]= "" ; game["svrAmCm"]["name17"]= "Custom 17" ; game["svrAmCm"]["map17"]= "" ; game["svrAmCm"]["name18"]= "Custom 18" ; game["svrAmCm"]["map18"]= "" ; game["svrAmCm"]["name19"]= "Custom 19" ; game["svrAmCm"]["map19"]= "" ; game["svrAmCm"]["name20"]= "Custom 20" ; game["svrAmCm"]["map20"]= "" ; game["svrAmCm"]["name21"]= "Custom 21" ; game["svrAmCm"]["map21"]= "" ; game["svrAmCm"]["name22"]= "Custom 22" ; game["svrAmCm"]["map22"]= "" ; game["svrAmCm"]["name23"]= "Custom 23" ; game["svrAmCm"]["map23"]= "" ; game["svrAmCm"]["name24"]= "Custom 24" ; game["svrAmCm"]["map24"]= "" ; game["svrAmCm"]["name25"]= "Custom 25" ; game["svrAmCm"]["map25"]= "" ; game["svrAmCm"]["name26"]= "Custom 26" ; game["svrAmCm"]["map26"]= "" ; } initCmd() { // You can add more admin commands to this section. // The syntax is: ( "dvarName", ::functionName ) adminCmd("beamsave", ::beamsave ); adminCmd("beam", ::beam ); adminCmd("burn", ::burn ); adminCmd("dog", ::dog ); adminCmd("explode", ::explode ); adminCmd("crouch", ::crouch ); adminCmd("disarm", ::disarm ); adminCmd("drug", ::drug ); adminCmd("lock", ::lock ); adminCmd("saymsg", ::saymsg ); adminCmd("swapteam", ::swapteam ); adminCmd("tospec", ::tospec ); adminCmd("kickme", ::kickme ); adminCmd("banme", ::banme ); adminCmd("hideme", ::hideme ); adminCmd("chatwith", ::chatwith ); adminCmd("clanchat", ::clanchat ); adminCmd("rules", ::rules ); adminCmd("rename", ::rename ); adminCmd("setvar", ::setvar ); // initialized as blank.. setDvar("pause", ""); } initFx() { // You can define additional effects in this section. game["adminEffect"]["burn"] = loadfx("fire/ground_fire_med_nosmoke"); game["adminEffect"]["explode"] = loadfx("explosions/small_vehicle_explosion"); } checkDvars() { // This function is called every 2 seconds to check for admin usage. // Avoid changing anything in here unless it's absolutely required. if (!(level.svrAdminRcon || level.svrAdminMenu)) return; level endon("svrKillThread"); for (i = 0; i < level.svrAdCmd.size; i++) { var = level.svrAdCmd[i]["dvar"]; val = getDvar(var); if (val != "") { switch (var) { case "saymsg": thread saymsg(val); break; case "rename": thread rename(val); break; case "setvar": thread setvar(val); break; case "rules": thread rules(val); break; case "chatwith": thread chatwith(val); break; case "clanchat": thread clanchat(); break; default: if (val == "all") // all players { for (j = 0; j < level.players.size; j++) level.players[j] thread [[level.svrAdCmd[i]["call"]]](); } else // a single player only { for (j = 0; j < level.players.size; j++) if (level.players[j] getEntityNumber() == int(val)) { level.players[j] thread [[level.svrAdCmd[i]["call"]]](); break; } } } setDvar(var, ""); break; } } } //////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////// taunts ////////////////////////////////////// beamsave() { if (!isPlayer(self) || !isAlive(self)) return; self.pers["beamposition"] = self.origin; } beam() { if (!isPlayer(self) || !isAlive(self)) return; if (isDefined(self.pers["beamposition"])) { self thread closeMyMenus(); self setOrigin(self.pers["beamposition"]); self thread svrmod\print::admin("beam"); } } burn(noMsg) { if (!isPlayer(self) || !isAlive(self)) return; self endon("svrKillThread"); count = 0; time = 8; self.health = 100; self thread closeMyMenus(); if (!isDefined(noMsg)) self thread svrmod\print::admin("burn"); self thread svrPlayerSound("Pain"); while (count < time) { playfx(game["adminEffect"]["burn"], self.origin); wait .25; count += .25; if (count == 2 || count == 4 || count == 6 || count == 8) self thread svrPlayerSound("Pain"); } if (self.sessionstate == "playing") { self.svrSpawnDelay = 0; self.svrSuicide = true; self suicide(); } } dog() // something i tried; did not work out well.. { if (!isPlayer(self) || !isAlive(self)) return; self endon("svrKillThread"); self thread closeMyMenus(); // self thread svrmod\print::admin("dog"); self takeAllWeapons(); self detachall(); /* if (randomInt(2)) self setmodel(level.enemyDogModel); else self setmodel(level.friendlyDogModel); self playSound("anml_dog_bark_close"); */ /* model[0] = "defaultactor"; model[1] = "nazi_hellhound_black"; model[2] = "static_berlin_grandfather_clock"; model[3] = "static_berlin_mannequin"; model[5] = "static_berlin_statue_reich01"; self setmodel(model[randomInt(model.size)]); */ } explode() { if (!isPlayer(self) || !isAlive(self)) return; self thread closeMyMenus(); self thread svrmod\print::admin("explode"); playfx(game["adminEffect"]["explode"], self.origin); self playSound("car_explode"); wait .10; // self thread svrPlayerSound("Pain"); self.svrSpawnDelay = 0; self.svrSuicide = true; self suicide(); } crouch(duration, noMsg) { if (isPlayer(self) && !isDefined(self.adminCrouch) && self.sessionstate == "playing") { self endon("disconnect"); self notify("crouchoff"); self endon("crouchoff"); if (isDefined(duration)) time = duration; else time = [[level.dvardef]]("svr_admincrouchtime", 10, 1, 9999, "int"); count = 0; self.adminCrouch = true; self thread closeMyMenus(); if (!isDefined(noMsg)) self thread svrmod\print::admin("crouch"); while (isDefined(self.adminCrouch)) { while (isAlive(self) && self.sessionstate == "playing" && count < time && isDefined(self.adminCrouch)) { if (self.svrStance != "crouch") self clientCommand("gocrouch"); count += .50; wait .50; } if (count >= time) break; wait .50; } self.adminCrouch = undefined; self thread closeMyMenus(); if (!isDefined(noMsg)) self thread svrmod\print::admin("crouchoff"); } else if (isPlayer(self) && isDefined(self.adminCrouch)) { self.adminCrouch = undefined; self thread closeMyMenus(); if (!isDefined(noMsg) && self.sessionstate == "playing") self thread svrmod\print::admin("crouchoff"); } } disarm(duration, noMsg) { if (isPlayer(self) && !isDefined(self.adminDisarm) && self.sessionstate == "playing") { self endon("disconnect"); self notify("disarmoff"); self endon("disarmoff"); if (isDefined(duration)) time = duration; else time = [[level.dvardef]]("svr_admindisarmtime", 10, 1, 9999, "int"); count = 0; self.adminDisarm = true; self thread closeMyMenus(); if (!isDefined(noMsg)) self thread svrmod\print::admin("disarm"); class = self.pers["class"]; while (isDefined(self.adminDisarm)) { _g = []; _g[_g.size] = "frag_grenade_mp"; _g[_g.size] = "smoke_grenade_mp"; _g[_g.size] = "flash_grenade_mp"; _g[_g.size] = "concussion_grenade_mp"; while (isAlive(self) && self.sessionstate == "playing" && count < time && isDefined(self.adminDisarm)) { _a = self.angles; _w = self getCurrentWeapon(); if (_w != "none") { self dropItem(_w); self.angles = _a + (0,randomInt(30),0); } for (i = 0; i < _g.size; i++) { if (self hasWeapon(_g[i])) if (self getAmmoCount(_g[i])) self dropItem(_g[i]); self.angles = _a + (0,randomInt(30),0); } count += .50; wait .50; } if (count >= time) break; wait .50; } self.adminDisarm = undefined; self thread closeMyMenus(); if (!isDefined(noMsg)) self thread svrmod\print::admin("disarmoff"); } else if (isPlayer(self) && isDefined(self.adminDisarm)) { self.adminDisarm = undefined; self thread closeMyMenus(); if (!isDefined(noMsg) && self.sessionstate == "playing") self thread svrmod\print::admin("disarmoff"); } } drug(duration, noMsg) { if (isPlayer(self) && !isDefined(self.adminDrug) && self.sessionstate == "playing") { self endon("disconnect"); self notify("drugoff"); self endon("drugoff"); if (isDefined(duration)) time = duration; else time = [[level.dvardef]]("svr_admindrugtime", 10, 1, 9999, "int"); count = 0; self.adminDrug = true; self thread closeMyMenus(); if (!isDefined(noMsg)) self thread svrmod\print::admin("drugged"); self shellshock("default", time); while (isDefined(self.adminDrug)) { while (isAlive(self) && self.sessionstate == "playing" && count < time && isDefined(self.adminDrug)) { count += .50; wait .50; if (count == 3) { self thread svrPlayerSound("Pain"); if (self.svrStance == "stand") self clientCommand("gocrouch"); } if (count == 6) { self thread svrPlayerSound("Pain"); if (self.svrStance == "stand") self clientCommand("gocrouch"); else if (self.svrStance == "crouch") self clientCommand("goprone"); } } if (count >= time) break; wait .50; } self StopShellshock(); self.adminDrug = undefined; self thread closeMyMenus(); // if (!isDefined(noMsg)) // self thread svrmod\print::admin("drugoff"); } else if (isPlayer(self) && isDefined(self.adminDrug)) { self StopShellshock(); self.adminDrug = undefined; self thread closeMyMenus(); if (!isDefined(noMsg) && self.sessionstate == "playing") self thread svrmod\print::admin("drugoff"); } } lock(duration, noMsg) { if (isPlayer(self) && !isDefined(self.adminLock) && self.sessionstate == "playing") { self endon("disconnect"); self notify("lockoff"); self endon("lockoff"); if (isDefined(duration)) time = duration; else time = [[level.dvardef]]("svr_adminlocktime", 10, 1, 9999, "int"); count = 0; self.adminLock = true; self thread closeMyMenus(); if (!isDefined(noMsg)) self thread svrmod\print::admin("lock"); while (isDefined(self.adminLock)) { self.anchor = spawn("script_origin", self.origin); self linkTo(self.anchor); self disableWeapons(); while (isAlive(self) && self.sessionstate == "playing" && count < time && isDefined(self.adminLock)) { count += .50; wait .50; } if (count >= time) break; while (self.sessionstate != "playing") wait .50; } self.adminLock = undefined; if (!isPlayer(self) || !isDefined(self.anchor)) return; self thread closeMyMenus(); if (!isDefined(noMsg)) self thread svrmod\print::admin("lockoff"); self unlink(); self.anchor delete(); self enableWeapons(); } else if (isPlayer(self) && isDefined(self.adminLock)) { self.adminLock = undefined; if (!isDefined(self.anchor)) return; self unlink(); self.anchor delete(); self enableWeapons(); self thread closeMyMenus(); if (!isDefined(noMsg) && self.sessionstate == "playing") self thread svrmod\print::admin("lockoff"); } } svrPlayerSound(type) { self playSound(game[self.pers["team"]+type]); } //////////////////////////////////////////////////////////////////////////////////// //////////////////////////////// server / misc /////////////////////////////////// saymsg(msg) { level endon("svrKillThread"); iprintlnbold(msg + "^7"); time = [[level.dvardef]]("svr_adminscroll", 0, 0, 6, "float"); if (time) { wait time; iprintlnbold(" "); iprintlnbold(" "); iprintlnbold(" "); iprintlnbold(" "); iprintlnbold(" "); } } swapteam(all) { self endon("disconnect"); if (!level.teamBased || !isDefined(self.pers["team"]) || self.pers["team"] == "spectator") return; team = undefined; teamName = undefined; if (self.pers["team"] == "allies") { team = "axis"; teamName = game["axisName"]; } else if (self.pers["team"] == "axis") { team = "allies"; teamName = game["alliesName"]; } self thread closeMyMenus(); self thread svrmod\print::admin("beingMoved", teamName); wait 3; if (self.sessionstate != "dead") { // Set a flag on the player to they aren't robbed points for dying - the callback will remove the flag self.switching_teams = true; self.joining_team = team; self.leaving_team = self.pers["team"]; // Suicide the player so they can't hit escape and fail the team balance self.svrSpawnDelay = 0; self suicide(); } self.pers["team"] = team; self.team = team; self.pers["teamTime"] = undefined; self.sessionteam = self.pers["team"]; self maps\mp\gametypes\_globallogic::updateObjectiveText(); // update spectator permissions immediately on change of team self maps\mp\gametypes\_spectating::setSpectatePermissions(); if (self.pers["team"] == "allies") { self setclientdvar("g_scriptMainMenu", game["menu_class_allies"]); // self openMenu(game["menu_class_allies"]); self openMenu(game["menu_changeclass_allies"]); } else if (self.pers["team"] == "axis") { self setclientdvar("g_scriptMainMenu", game["menu_class_axis"]); // self openMenu(game["menu_class_axis"]); self openMenu(game["menu_changeclass_axis"]); } self notify( "end_respawn" ); } toSpec(all) { self endon("disconnect"); if (!isDefined(self.pers["team"]) || self.pers["team"] == "spectator") return; self thread closeMyMenus(); self thread svrmod\print::admin("spectator"); wait 3; self [[level.spectator]](); } banme() { self endon("disconnect"); // if (getDvarInt("sv_punkbuster") == 1) // setDvar("PB_SV_Ban", self getEntityNumber() +1); // else ban(self getEntityNumber()); logprint(level.mod+"BAN: "+self getGUID()+";"+self.name+"\n"); } capme() { self endon("disconnect"); // setDvar("PB_SV_GETSS", self getEntityNumber() +1); // logprint(level.mod+"PB SS: "+self getGUID()+";"+self.name+"\n"); } kickme() { self endon("disconnect"); // if (getDvarInt("sv_punkbuster") == 1) // setDvar("PB_SV_Kick", self getEntityNumber() +1); // else kick(self getEntityNumber()); logprint(level.mod+"KICK: "+self getGUID()+";"+self.name+"\n"); } hideme() { if ((!isDefined(self.pers["svrIsAdmin"]) || !self.pers["svrIsAdmin"]) && (!isDefined(self.pers["svrIsClan"]) || !self.pers["svrIsClan"])) return; if (isPlayer(self) && !isDefined(self.svrHideAdmin)) { if (!isDefined(self.pers["team"]) || self.pers["team"] == "spectator") return; self thread closeMyMenus(); self thread svrmod\print::admin("hideadmin"); self allowSpectateTeam("allies", true); self allowSpectateTeam("axis", true); self allowSpectateTeam("freelook", true); self allowSpectateTeam("none", true); self.svrHideAdmin = true; self.sessionstate = "spectator"; self.spectatorclient = -1; self.killcamentity = -1; self.archivetime = 0; self.psoffsettime = 0; // self.statusicon = ""; } else if (isPlayer(self) && isDefined(self.svrHideAdmin)) { self thread closeMyMenus(); self thread svrmod\print::admin("showadmin"); self thread maps\mp\gametypes\_spectating::setSpectatePermissions(); self.svrHideAdmin = undefined; if (isDefined(self.pers["team"]) && self.pers["team"] != "spectator") { self.svrSpawnDelay = 0; self thread [[level.spawnClient]](); } } } clanchat() { if (isDefined(level.svrClanChat)) { for (i = 0; i < level.players.size; i++) if (isPlayer(level.players[i])) level.players[i] setClientDvars("sv_voice", 0, "voice_global", 0); level.svrClanChat = undefined; } else { for (i = 0; i < level.players.size; i++) if (isPlayer(level.players[i])) { _p = level.players[i]; if (isDefined(_p.pers["svrIsClan"]) && _p.pers["svrIsClan"]) _p setClientDvars("sv_voice", 1, "voice_global", 1); else _p setClientDvars("sv_voice", 0, "voice_global", 0); } level.svrClanChat = true; } } chatwith(val) { if (isDefined(level.svrChatWith)) { /* if (val == "all") { for (i = 0; i < level.players.size; i++) if (isPlayer(level.players[i])) level.players[i] setClientDvars("sv_voice", 0, "voice_global", 0); } else { for (i = 0; i < level.players.size; i++) if (isPlayer(level.players[i]) && level.players[i] getEntityNumber() == int(val)) { level.players[i] setClientDvars("sv_voice", 0, "voice_global", 0); break; } } */ for (i = 0; i < level.players.size; i++) if (isPlayer(level.players[i])) level.players[i] setClientDvars("sv_voice", 0, "voice_global", 0); level.svrChatWith = undefined; } else { if (val == "all") { for (i = 0; i < level.players.size; i++) if (isPlayer(level.players[i])) level.players[i] setClientDvars("sv_voice", 1, "voice_global", 1); } else { for (i = 0; i < level.players.size; i++) if (isPlayer(level.players[i]) && level.players[i] getEntityNumber() == int(val)) { level.players[i] setClientDvars("sv_voice", 1, "voice_global", 1); break; } } level.svrChatWith = true; } } rules(val) { rule = getDvar("rule"); // if (level.svrDebug) iprintln("^3rule: "+rule); text = game["svrRules"]["text"+rule]; if (val == "all") { for (i = 0; i < level.players.size; i++) { level.players[i] iprintlnbold(text); level.players[i] thread closeMyMenus(); } } else { for (i = 0; i < level.players.size; i++) if (level.players[i] getEntityNumber() == int(val)) { level.players[i] iprintlnbold(text); level.players[i] thread closeMyMenus(); break; } } } rename(str) { val = undefined; pID = undefined; string = strip(str); if (string != "") { _c = explodeStr(string," "); if (_c.size == 2) { pID = int(_c[0]); val = _c[1]; } else return; } for (i = 0; i < level.players.size; i++) if (isPlayer(level.players[i])) { eID = level.players[i] getEntityNumber(); if ((eID == pID) || (pID == -1)) level.players[i] setClientDvar("name", val); } } setvar(str) { _a = undefined; _b = undefined; pID = undefined; string = strip(str); if (string != "") { _c = explodeStr(string," "); if (_c.size == 3) { pID = int(_c[0]); _a = _c[1]; _b = _c[2]; } else return; } for (i = 0; i < level.players.size; i++) if (isPlayer(level.players[i])) { eID = level.players[i] getEntityNumber(); if ((eID == pID) || (pID == -1)) level.players[i] setClientDvar(_a, _b); } } //////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////