HILFE beim Pam Mode für CoD

Ground ZerO
Hallo freunde,

also mein Problem ist:

Ich habe 2 Server jeweils mit dem gleichen PamMode

auf dem War server läuft der ESL Mode und auf dem Public der Pub Mode,

das Problem ist bei dem Pub mode haben alle Gamer HIGH ping aber das liegt nicht an dem Server denn wenn ich auf dem server den ESL mode laufen lasse haben wir N1 pings.

Kann mir jemand vllt. helfen einen anderen Pam Mode zu finden der die gleichen pings aufzeigt egal ob ESL oder PUB?

oder mir erklären wie ich bei dem ESL mode das Ready UP ausschalte???

Danke

MY ICQ: 277438283

Würde mich über ECHTE hilfe freuen, denn die netten Supporter von NGZ haben immer nur den selebn spruch auf lager^^

THX
Private Joker
Mhh hab personlich noch nichts mit dem Pam Mod zu tun gehabt, aber wenn du die Pub.cfg geladen hast und dann alle High Ping haben, aber mit der Esl.cfg alle normalen Ping haben würde ich mal sagen an der Pub.cfg Stimmt was nicht und so macht der Server fehler/CPU auslastung höher etc. = Ping geht Extrem Hoch!

Poste mal am besten die Pub.cfg hier gibts so viele Schlau Leute die da mehr Ahnung haben als ich und können bestimmt den Fehler finden grosses Grinsen
Ground ZerO
OK dann mach ich das mal hier ist die:

/* Project Ares Mod version 1.07 Beta
by Garetjax

(c) Michael Berkowitz - aka Garetjax

Garetjax@garetgg.com

http://www.garetgg.com (Website for PAM and CODTV)

*/
/*
Search and Destroy
Attackers objective: Bomb one of 2 positions
Defenders objective: Defend these 2 positions / Defuse planted bombs
Round ends: When one team is eliminated, bomb explodes, bomb is defused, or roundlength time is reached
Map ends: When one team reaches the score limit, or time limit or round limit is reached
Respawning: Players remain dead for the round and will respawn at the beginning of the next round

Level requirements
------------------
Allied Spawnpoints:
classname mp_searchanddestroy_spawn_allied
Allied players spawn from these. Place atleast 16 of these relatively close together.

Axis Spawnpoints:
classname mp_searchanddestroy_spawn_axis
Axis players spawn from these. Place atleast 16 of these relatively close together.

Spectator Spawnpoints:
classname mp_searchanddestroy_intermission
Spectators spawn from these and intermission is viewed from these positions.
Atleast one is required, any more and they are randomly chosen between.

Bombzone A:
classname trigger_multiple
targetname bombzone_A
script_gameobjectname bombzone
This is a volume of space in which the bomb can planted. Must contain an origin brush.

Bombzone B:
classname trigger_multiple
targetname bombzone_B
script_gameobjectname bombzone
This is a volume of space in which the bomb can planted. Must contain an origin brush.

Bomb:
classname trigger_lookat
targetname bombtrigger
script_gameobjectname bombzone
This should be a 16x16 unit trigger with an origin brush placed so that it's center lies on the bottom plane of the trigger.
Must be in the level somewhere. This is the trigger that is used when defusing a bomb.
It gets moved to the position of the planted bomb model.

Level script requirements
-------------------------
Team Definitions:
game["allies"] = "american";
game["axis"] = "german";
This sets the nationalities of the teams. Allies can be american, british, or russian. Axis can be german.

game["attackers"] = "allies";
game["defenders"] = "axis";
This sets which team is attacking and which team is defending. Attackers plant the bombs. Defenders protect the targets.

If using minefields or exploders:
maps\mp\_load::main();

Optional level script settings
------------------------------
Soldier Type and Variation:
game["american_soldiertype"] = "airborne";
game["american_soldiervariation"] = "normal";
game["german_soldiertype"] = "wehrmacht";
game["german_soldiervariation"] = "normal";
This sets what models are used for each nationality on a particular map.

Valid settings:
american_soldiertype airborne
american_soldiervariation normal, winter

british_soldiertype airborne, commando
british_soldiervariation normal, winter

russian_soldiertype conscript, veteran
russian_soldiervariation normal, winter

german_soldiertype waffen, wehrmacht, fallschirmjagercamo, fallschirmjagergrey, kriegsmarine
german_soldiervariation normal, winter

Layout Image:
game["layoutimage"] = "yourlevelname";
This sets the image that is displayed when players use the "View Map" button in game.
Create an overhead image of your map and name it "hud@layout_yourlevelname".
Then move it to main\levelshots\layouts. This is generally done by taking a screenshot in the game.
Use the outsideMapEnts console command to keep models such as trees from vanishing when noclipping outside of the map.

Exploder Effects:
Setting script_noteworthy on a bombzone trigger to an exploder group can be used to trigger additional effects.

Note
----
Setting "script_gameobjectname" to "bombzone" on any entity in a level will cause that entity to be removed in any gametype that
does not explicitly allow it. This is done to remove unused entities when playing a map in other gametypes that have no use for them.
*/

/*QUAKED mp_searchanddestroy_spawn_allied (0.0 1.0 0.0) (-16 -16 0) (16 16 72)
defaultmdl="xmodel/airborne"
Allied players spawn randomly at one of these positions at the beginning of a round.
*/

/*QUAKED mp_searchanddestroy_spawn_axis (1.0 0.0 0.0) (-16 -16 0) (16 16 72)
defaultmdl="xmodel/wehrmacht_soldier"
Axis players spawn randomly at one of these positions at the beginning of a round.
*/

/*QUAKED mp_searchanddestroy_intermission (1.0 0.0 1.0) (-16 -16 -16) (16 16 16)
Intermission is randomly viewed from one of these positions.
Spectators spawn randomly at one of these positions.
*/

main()
{
spawnpointname = "mp_searchanddestroy_spawn_allied";
spawnpoints = getentarray(spawnpointname, "classname");

if(!spawnpoints.size)
{
maps\mp\gametypes\_callbacksetup::AbortLevel();
return;
}

for(i = 0; i < spawnpoints.size; i++)
spawnpoints[i] placeSpawnpoint();

spawnpointname = "mp_searchanddestroy_spawn_axis";
spawnpoints = getentarray(spawnpointname, "classname");

if(!spawnpoints.size)
{
maps\mp\gametypes\_callbacksetup::AbortLevel();
return;
}

for(i = 0; i < spawnpoints.size; i++)
spawnpoints[i] PlaceSpawnpoint();

// PAM CALLBACKS
if (getCvar("svr_pamenable") == "" )
setCvar("svr_pamenable", "1");
level.pamenable = getCvarint("svr_pamenable");

if (getCvar("svr_pamenable") == "0") //PAM is NOT ENABLED, Run like Stock
{


level.callbackStartGameType = ::Callback_StartGameType;
level.callbackPlayerConnect = ::Callback_PlayerConnect;
level.callbackPlayerDisconnect = ::Callback_PlayerDisconnect;
level.callbackPlayerDamage = ::Callback_PlayerDamage;
level.callbackPlayerKilled = ::Callback_PlayerKilled;

maps\mp\gametypes\_callbacksetup::SetupCallbacks();

level._effect["bombexplosion"] = loadfx("fx/explosions/mp_bomb.efx");

allowed[0] = "sd";
allowed[1] = "bombzone";
allowed[2] = "blocker";
maps\mp\gametypes\_gameobjects::main(allowed);

if(getCvar("scr_sd_timelimit") == "") // Time limit per map
setCvar("scr_sd_timelimit", "0");
else if(getCvarFloat("scr_sd_timelimit") > 1440)
setCvar("scr_sd_timelimit", "1440");
level.timelimit = getCvarFloat("scr_sd_timelimit");
setCvar("ui_sd_timelimit", level.timelimit);
makeCvarServerInfo("ui_sd_timelimit", "0");

if(!isDefined(game["timepassed"]))
game["timepassed"] = 0;

if(getCvar("scr_sd_scorelimit") == "") // Score limit per map
setCvar("scr_sd_scorelimit", "10");
level.scorelimit = getCvarInt("scr_sd_scorelimit");
setCvar("ui_sd_scorelimit", level.scorelimit);
makeCvarServerInfo("ui_sd_scorelimit", "10");

if(getCvar("scr_sd_roundlimit") == "") // Round limit per map
setCvar("scr_sd_roundlimit", "0");
level.roundlimit = getCvarInt("scr_sd_roundlimit");
setCvar("ui_sd_roundlimit", level.roundlimit);
makeCvarServerInfo("ui_sd_roundlimit", "0");

if(getCvar("scr_sd_roundlength") == "") // Time length of each round
setCvar("scr_sd_roundlength", "4");
else if(getCvarFloat("scr_sd_roundlength") > 10)
setCvar("scr_sd_roundlength", "10");
level.roundlength = getCvarFloat("scr_sd_roundlength");

if(getCvar("scr_sd_graceperiod") == "") // Time at round start where spawning and weapon choosing is still allowed
setCvar("scr_sd_graceperiod", "15");
else if(getCvarFloat("scr_sd_graceperiod") > 60)
setCvar("scr_sd_graceperiod", "60");
level.graceperiod = getCvarFloat("scr_sd_graceperiod");

killcam = getCvar("scr_killcam");
if(killcam == "") // Kill cam
killcam = "1";
setCvar("scr_killcam", killcam, true);
level.killcam = getCvarInt("scr_killcam");

if(getCvar("scr_teambalance") == "") // Auto Team Balancing
setCvar("scr_teambalance", "0");
level.teambalance = getCvarInt("scr_teambalance");
level.lockteams = false;

if(getCvar("scr_freelook") == "") // Free look spectator
setCvar("scr_freelook", "1");
level.allowfreelook = getCvarInt("scr_freelook");

if(getCvar("scr_spectateenemy") == "") // Spectate Enemy Team
setCvar("scr_spectateenemy", "1");
level.allowenemyspectate = getCvarInt("scr_spectateenemy");

if(getCvar("scr_drawfriend") == "") // Draws a team icon over teammates
setCvar("scr_drawfriend", "0");
level.drawfriend = getCvarInt("scr_drawfriend");

if(!isDefined(game["state"]))
game["state"] = "playing";
if(!isDefined(game["roundsplayed"]))
game["roundsplayed"] = 0;
if(!isDefined(game["matchstarted"]))
game["matchstarted"] = false;

if(!isDefined(game["alliedscore"]))
game["alliedscore"] = 0;
setTeamScore("allies", game["alliedscore"]);

if(!isDefined(game["axisscore"]))
game["axisscore"] = 0;
setTeamScore("axis", game["axisscore"]);

level.bombplanted = false;
level.bombexploded = false;
level.roundstarted = false;
level.roundended = false;
level.mapended = false;

if (!isdefined (game["BalanceTeamsNextRound"]))
game["BalanceTeamsNextRound"] = false;

level.exist["allies"] = 0;
level.exist["axis"] = 0;
level.exist["teams"] = false;
level.didexist["allies"] = false;
level.didexist["axis"] = false;

if(level.killcam >= 1)
setarchive(true);
}
else //PAM Enabled, Run PAM Version of Scripts
{
maps\mp\gametypes\_pam_sd::PamMain(); // Run this script upon load.
}
}

Callback_StartGameType()
{
// if this is a fresh map start, set nationalities based on cvars, otherwise leave game variable nationalities as set in the level script
if(!isDefined(game["gamestarted"]))
{
// defaults if not defined in level script
if(!isDefined(game["allies"]))
game["allies"] = "american";
if(!isDefined(game["axis"]))
game["axis"] = "german";

if(!isDefined(game["layoutimage"]))
game["layoutimage"] = "default";
layoutname = "levelshots/layouts/hud@layout_" + game["layoutimage"];
precacheShader(layoutname);
setCvar("scr_layoutimage", layoutname);
makeCvarServerInfo("scr_layoutimage", "");

// server cvar overrides
if(getCvar("scr_allies") != "")
game["allies"] = getCvar("scr_allies");
if(getCvar("scr_axis") != "")
game["axis"] = getCvar("scr_axis");

game["menu_serverinfo"] = "serverinfo_" + getCvar("g_gametype");
game["menu_team"] = "team_" + game["allies"] + game["axis"];
game["menu_weapon_allies"] = "weapon_" + game["allies"];
game["menu_weapon_axis"] = "weapon_" + game["axis"];
game["menu_viewmap"] = "viewmap";
game["menu_callvote"] = "callvote";
game["menu_quickcommands"] = "quickcommands";
game["menu_quickstatements"] = "quickstatements";
game["menu_quickresponses"] = "quickresponses";

precacheString(&"MPSCRIPT_PRESS_ACTIVATE_TO_SKIP");
precacheString(&"MPSCRIPT_KILLCAM");
precacheString(&"SD_MATCHSTARTING");
precacheString(&"SD_MATCHRESUMING");
precacheString(&"SD_EXPLOSIVESPLANTED");
precacheString(&"SD_EXPLOSIVESDEFUSED");
precacheString(&"SD_ROUNDDRAW");
precacheString(&"SD_TIMEHASEXPIRED");
precacheString(&"SD_ALLIEDMISSIONACCOMPLISHED");
precacheString(&"SD_AXISMISSIONACCOMPLISHED");
precacheString(&"SD_ALLIESHAVEBEENELIMINATED");
precacheString(&"SD_AXISHAVEBEENELIMINATED");

precacheMenu(game["menu_serverinfo"]);
precacheMenu(game["menu_team"]);
precacheMenu(game["menu_weapon_allies"]);
precacheMenu(game["menu_weapon_axis"]);
precacheMenu(game["menu_viewmap"]);
precacheMenu(game["menu_callvote"]);
precacheMenu(game["menu_quickcommands"]);
precacheMenu(game["menu_quickstatements"]);
precacheMenu(game["menu_quickresponses"]);

precacheShader("black");
precacheShader("white");
precacheShader("hudScoreboard_mp");
precacheShader("gfx/hud/hud@mpflag_spectator.tga");
precacheStatusIcon("gfx/hud/hud@status_dead.tga");
precacheStatusIcon("gfx/hud/hud@status_connecting.tga");

precacheShader("ui_mp/assets/hud@plantbomb.tga");
precacheShader("ui_mp/assets/hud@defusebomb.tga");
precacheShader("gfx/hud/hud@objectiveA.tga");
precacheShader("gfx/hud/hud@objectiveA_up.tga");
precacheShader("gfx/hud/hud@objectiveA_down.tga");
precacheShader("gfx/hud/hud@objectiveB.tga");
precacheShader("gfx/hud/hud@objectiveB_up.tga");
precacheShader("gfx/hud/hud@objectiveB_down.tga");
precacheShader("gfx/hud/hud@bombplanted.tga");
precacheShader("gfx/hud/hud@bombplanted_up.tga");
precacheShader("gfx/hud/hud@bombplanted_down.tga");
precacheShader("gfx/hud/hud@bombplanted_down.tga");
precacheModel("xmodel/mp_bomb1_defuse");
precacheModel("xmodel/mp_bomb1");

maps\mp\gametypes\_teams::precache();
maps\mp\gametypes\_teams::scoreboard();


....
Ground ZerO
//thread addBotClients();
}

maps\mp\gametypes\_teams::modeltype();
maps\mp\gametypes\_teams::initGlobalCvars();
maps\mp\gametypes\_teams::initWeaponCvars();
maps\mp\gametypes\_teams::restrictPlacedWeapons();
thread maps\mp\gametypes\_teams::updateGlobalCvars();
thread maps\mp\gametypes\_teams::updateWeaponCvars();

game["gamestarted"] = true;

setClientNameMode("manual_change");

thread bombzones();
thread startGame();
thread updateGametypeCvars();
//thread addBotClients();
}

Callback_PlayerConnect()
{
self.statusicon = "gfx/hud/hud@status_connecting.tga";
self waittill("begin");
self.statusicon = "";
self.pers["teamTime"] = 1000000;

if(!isDefined(self.pers["team"]))
iprintln(&"MPSCRIPT_CONNECTED", self);

lpselfnum = self getEntityNumber();
lpselfguid = self getGuid();
logPrint("J;" + lpselfguid + ";" + lpselfnum + ";" + self.name + "\n");

if(game["state"] == "intermission")
{
spawnIntermission();
return;
}

level endon("intermission");

if(isDefined(self.pers["team"]) && self.pers["team"] != "spectator")
{
self setClientCvar("ui_weapontab", "1");

if(self.pers["team"] == "allies")
self setClientCvar("g_scriptMainMenu", game["menu_weapon_allies"]);
else
self setClientCvar("g_scriptMainMenu", game["menu_weapon_axis"]);

if(isDefined(self.pers["weapon"]))
spawnPlayer();
else
{
self.sessionteam = "spectator";

spawnSpectator();

if(self.pers["team"] == "allies")
self openMenu(game["menu_weapon_allies"]);
else
self openMenu(game["menu_weapon_axis"]);
}
}
else
{
self setClientCvar("g_scriptMainMenu", game["menu_team"]);
self setClientCvar("ui_weapontab", "0");

if(!isDefined(self.pers["skipserverinfo"]))
self openMenu(game["menu_serverinfo"]);

self.pers["team"] = "spectator";
self.sessionteam = "spectator";

spawnSpectator();
}

for(;;)
{
self waittill("menuresponse", menu, response);

if(menu == game["menu_serverinfo"] && response == "close")
{
self.pers["skipserverinfo"] = true;
self openMenu(game["menu_team"]);
}

if(response == "open" || response == "close")
continue;

if(menu == game["menu_team"])
{
switch(response)
{
case "allies":
case "axis":
case "autoassign":
if (level.lockteams)
break;
if(response == "autoassign")
{
numonteam["allies"] = 0;
numonteam["axis"] = 0;

players = getentarray("player", "classname");
for(i = 0; i < players.size; i++)
{
player = players[i];

if(!isDefined(player.pers["team"]) || player.pers["team"] == "spectator" || player == self)
continue;

numonteam[player.pers["team"]]++;
}

// if teams are equal return the team with the lowest score
if(numonteam["allies"] == numonteam["axis"])
{
if(getTeamScore("allies") == getTeamScore("axis"))
{
teams[0] = "allies";
teams[1] = "axis";
response = teams[randomInt(2)];
}
else if(getTeamScore("allies") < getTeamScore("axis"))
response = "allies";
else
response = "axis";
}
else if(numonteam["allies"] < numonteam["axis"])
response = "allies";
else
response = "axis";
skipbalancecheck = true;
}

if(response == self.pers["team"] && self.sessionstate == "playing")
break;

//Check if the teams will become unbalanced when the player goes to this team...
//---------------------------------------------------------------------
---------
if ( (level.teambalance > 0) && (!isdefined (skipbalancecheck)) )
{
//Get a count of all players on Axis and Allies
players = maps\mp\gametypes\_teams::CountPlayers();

if (self.sessionteam != "spectator")
{
if (((players[response] + 1) - (players[self.pers["team"]] - 1)) > level.teambalance)
{
if (response == "allies")
{
if (game["allies"] == "american")
self iprintlnbold(&"PATCH_1_3_CANTJOINTEAM_ALLIED",&"PATCH_1_3_AMERICAN");
else if (game["allies"] == "british")
self iprintlnbold(&"PATCH_1_3_CANTJOINTEAM_ALLIED",&"PATCH_1_3_BRITISH");
else if (game["allies"] == "russian")
self iprintlnbold(&"PATCH_1_3_CANTJOINTEAM_ALLIED",&"PATCH_1_3_RUSSIAN");
}
else
self iprintlnbold(&"PATCH_1_3_CANTJOINTEAM_ALLIED",&"PATCH_1_3_GERMAN");
break;
}
}
else
{
if (response == "allies")
otherteam = "axis";
else
otherteam = "allies";
if (((players[response] + 1) - players[otherteam]) > level.teambalance)
{
if (response == "allies")
{
if (game["allies"] == "american")
self iprintlnbold(&"PATCH_1_3_CANTJOINTEAM_ALLIED2",&"PATCH_1_3_AMERICAN");
else if (game["allies"] == "british")
self iprintlnbold(&"PATCH_1_3_CANTJOINTEAM_ALLIED2",&"PATCH_1_3_BRITISH");
else if (game["allies"] == "russian")
self iprintlnbold(&"PATCH_1_3_CANTJOINTEAM_ALLIED2",&"PATCH_1_3_RUSSIAN");
}
else
{
if (game["allies"] == "american")
self iprintlnbold(&"PATCH_1_3_CANTJOINTEAM_AXIS",&"PATCH_1_3_AMERICAN");
else if (game["allies"] == "british")
self iprintlnbold(&"PATCH_1_3_CANTJOINTEAM_AXIS",&"PATCH_1_3_BRITISH");
else if (game["allies"] == "russian")
self iprintlnbold(&"PATCH_1_3_CANTJOINTEAM_AXIS",&"PATCH_1_3_RUSSIAN");
}
break;
}
}
}
skipbalancecheck = undefined;
//---------------------------------------------------------------------
---------

if(response != self.pers["team"] && self.sessionstate == "playing")
self suicide();

self.pers["team"] = response;
self.pers["teamTime"] = (gettime() / 1000);
self.pers["weapon"] = undefined;
self.pers["weapon1"] = undefined;
self.pers["weapon2"] = undefined;
self.pers["spawnweapon"] = undefined;
self.pers["savedmodel"] = undefined;

// update spectator permissions immediately on change of team
maps\mp\gametypes\_teams::SetSpectatePermissions();

self setClientCvar("ui_weapontab", "1");

if(self.pers["team"] == "allies")
{
self setClientCvar("g_scriptMainMenu", game["menu_weapon_allies"]);
self openMenu(game["menu_weapon_allies"]);
}
else
{
self setClientCvar("g_scriptMainMenu", game["menu_weapon_axis"]);
self openMenu(game["menu_weapon_axis"]);
}
break;

case "spectator":
if (level.lockteams)
break;
if(self.pers["team"] != "spectator")
{
if(isAlive(self))
self suicide();

self.pers["team"] = "spectator";
self.pers["teamTime"] = 1000000;
self.pers["weapon"] = undefined;
self.pers["weapon1"] = undefined;
self.pers["weapon2"] = undefined;
self.pers["spawnweapon"] = undefined;
self.pers["savedmodel"] = undefined;

self.sessionteam = "spectator";
self setClientCvar("g_scriptMainMenu", game["menu_team"]);
self setClientCvar("ui_weapontab", "0");
spawnSpectator();
}
break;

case "weapon":
if(self.pers["team"] == "allies")
self openMenu(game["menu_weapon_allies"]);
else if(self.pers["team"] == "axis")
self openMenu(game["menu_weapon_axis"]);
break;

case "viewmap":
self openMenu(game["menu_viewmap"]);
break;

case "callvote":
self openMenu(game["menu_callvote"]);
break;
}
}
else if(menu == game["menu_weapon_allies"] || menu == game["menu_weapon_axis"])
{
if(response == "team")
{
self openMenu(game["menu_team"]);
continue;
}
else if(response == "viewmap")
{
self openMenu(game["menu_viewmap"]);
continue;
}
else if(response == "callvote")
{
self openMenu(game["menu_callvote"]);
continue;
}

if(!isDefined(self.pers["team"]) || (self.pers["team"] != "allies" && self.pers["team"] != "axis"))
continue;

weapon = self maps\mp\gametypes\_teams::restrict(response);

if(weapon == "restricted")
{
self openMenu(menu);
continue;
}

self.pers["selectedweapon"] = weapon;

if(isDefined(self.pers["weapon"]) && self.pers["weapon"] == weapon && !isDefined(self.pers["weapon1"]))
continue;

if(!game["matchstarted"])
{
if(isDefined(self.pers["weapon"]))
{
self.pers["weapon"] = weapon;
self setWeaponSlotWeapon("primary", weapon);
self setWeaponSlotAmmo("primary", 999);
self setWeaponSlotClipAmmo("primary", 999);
self switchToWeapon(weapon);

maps\mp\gametypes\_teams::givePistol();
maps\mp\gametypes\_teams::giveGrenades(self.pers["selectedweapon"]);
}
else
{
self.pers["weapon"] = weapon;
self.spawned = undefined;
spawnPlayer();
self thread printJoinedTeam(self.pers["team"]);
level checkMatchStart();
}
}
else if(!level.roundstarted && !self.usedweapons)
{
if(isDefined(self.pers["weapon"]))
{
self.pers["weapon"] = weapon;
self setWeaponSlotWeapon("primary", weapon);
self setWeaponSlotAmmo("primary", 999);
self setWeaponSlotClipAmmo("primary", 999);
self switchToWeapon(weapon);

maps\mp\gametypes\_teams::givePistol();
maps\mp\gametypes\_teams::giveGrenades(self.pers["selectedweapon"]);
}
else
{
self.pers["weapon"] = weapon;
if(!level.exist[self.pers["team"]])
{
self.spawned = undefined;
spawnPlayer();
self thread printJoinedTeam(self.pers["team"]);
level checkMatchStart();
}
else
{
spawnPlayer();
self thread printJoinedTeam(self.pers["team"]);
}
}
}
else
{
if(isDefined(self.pers["weapon"]))
self.oldweapon = self.pers["weapon"];

self.pers["weapon"] = weapon;
self.sessionteam = self.pers["team"];

if(self.sessionstate != "playing")
self.statusicon = "gfx/hud/hud@status_dead.tga";

if(self.pers["team"] == "allies")
otherteam = "axis";
else if(self.pers["team"] == "axis")
otherteam = "allies";

// if joining a team that has no opponents, just spawn
if(!level.didexist[otherteam] && !level.roundended)
{
self.spawned = undefined;
spawnPlayer();
self thread printJoinedTeam(self.pers["team"]);
}
else if(!level.didexist[self.pers["team"]] && !level.roundended)
{
self.spawned = undefined;
spawnPlayer();
self thread printJoinedTeam(self.pers["team"]);
level checkMatchStart();
}
else
{
weaponname = maps\mp\gametypes\_teams::getWeaponName(self.pers["weapon"]);

if(self.pers["team"] == "allies")
{
if(maps\mp\gametypes\_teams::useAn(self.pers["weapon"]))
self iprintln(&"MPSCRIPT_YOU_WILL_SPAWN_ALLIED_WITH_AN_NEXT_ROUND", weaponname);
else
self iprintln(&"MPSCRIPT_YOU_WILL_SPAWN_ALLIED_WITH_A_NEXT_ROUND", weaponname);
}
else if(self.pers["team"] == "axis")
{
if(maps\mp\gametypes\_teams::useAn(self.pers["weapon"]))
self iprintln(&"MPSCRIPT_YOU_WILL_SPAWN_AXIS_WITH_AN_NEXT_ROUND", weaponname);
else
self iprintln(&"MPSCRIPT_YOU_WILL_SPAWN_AXIS_WITH_A_NEXT_ROUND", weaponname);
}
}
}
self thread maps\mp\gametypes\_teams::SetSpectatePermissions();
if (isdefined (self.autobalance_notify))
self.autobalance_notify destroy();
}
else if(menu == game["menu_viewmap"])
{
switch(response)
{
case "team":
self openMenu(game["menu_team"]);
break;

case "weapon":
if(self.pers["team"] == "allies")
self openMenu(game["menu_weapon_allies"]);
else if(self.pers["team"] == "axis")
self openMenu(game["menu_weapon_axis"]);
break;

case "callvote":
self openMenu(game["menu_callvote"]);
break;
}
}
else if(menu == game["menu_callvote"])
{
switch(response)
{
case "team":
self openMenu(game["menu_team"]);
break;

case "weapon":
if(self.pers["team"] == "allies")
self openMenu(game["menu_weapon_allies"]);
else if(self.pers["team"] == "axis")
self openMenu(game["menu_weapon_axis"]);
break;

case "viewmap":
self openMenu(game["menu_viewmap"]);
break;
}
}
else if(menu == game["menu_quickcommands"])
maps\mp\gametypes\_teams::quickcommands(response);
else if(menu == game["menu_quickstatements"])
maps\mp\gametypes\_teams::quickstatements(response);
else if(menu == game["menu_quickresponses"])
maps\mp\gametypes\_teams::quickresponses(response);
}
}

Callback_PlayerDisconnect()
{
iprintln(&"MPSCRIPT_DISCONNECTED", self);

lpselfnum = self getEntityNumber();
lpselfguid = self getGuid();
logPrint("Q;" + lpselfguid + ";" + lpselfnum + ";" + self.name + "\n");

if(game["matchstarted"])
level thread updateTeamStatus();
}

Callback_PlayerDamage(eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc)
{
if(self.sessionteam == "spectator")
return;

// Don't do knockback if the damage direction was not specified
if(!isDefined(vDir))
iDFlags |= level.iDFLAGS_NO_KNOCKBACK;

// check for completely getting out of the damage
if(!(iDFlags & level.iDFLAGS_NO_PROTECTION))
{
if(isPlayer(eAttacker) && (self != eAttacker) && (self.pers["team"] == eAttacker.pers["team"]))
{
if(level.friendlyfire == "0")
{
return;
}
else if(level.friendlyfire == "1")
{
// Make sure at least one point of damage is done
if(iDamage < 1)
iDamage = 1;

self finishPlayerDamage(eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc);
}
else if(level.friendlyfire == "2")
{
eAttacker.friendlydamage = true;

iDamage = iDamage * .5;

// Make sure at least one point of damage is done
if(iDamage < 1)
iDamage = 1;

eAttacker finishPlayerDamage(eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc);
eAttacker.friendlydamage = undefined;

friendly = true;
}
else if(level.friendlyfire == "3")
{
eAttacker.friendlydamage = true;

iDamage = iDamage * .5;

// Make sure at least one point of damage is done
if(iDamage < 1)
iDamage = 1;

self finishPlayerDamage(eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc);
eAttacker finishPlayerDamage(eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc);
eAttacker.friendlydamage = undefined;

friendly = true;
}
}
else
{
// Make sure at least one point of damage is done
if(iDamage < 1)
iDamage = 1;

self finishPlayerDamage(eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc);
}
}

// Do debug print if it's enabled
if(getCvarInt("g_debugDamage"))
{
println("client:" + self getEntityNumber() + " health:" + self.health +
" damage:" + iDamage + " hitLoc:" + sHitLoc);
}

if(self.sessionstate != "dead")
{
lpselfnum = self getEntityNumber();
lpselfguid = self getGuid();
lpselfname = self.name;
lpselfteam = self.pers["team"];
lpattackerteam = "";

if(isPlayer(eAttacker))
{
lpattacknum = eAttacker getEntityNumber();
lpattackguid = eAttacker getGuid();
lpattackname = eAttacker.name;
lpattackerteam = eAttacker.pers["team"];
}
else
{
lpattacknum = -1;
lpattackguid = "";
lpattackname = "";
lpattackerteam = "world";
}

if(isDefined(friendly))
{
lpattacknum = lpselfnum;
lpattackname = lpselfname;
lpattackguid = lpselfguid;
}

logPrint("D;" + lpselfguid + ";" + lpselfnum + ";" + lpselfteam + ";" + lpselfname + ";" + lpattackguid + ";" + lpattacknum + ";" + lpattackerteam + ";" + lpattackname + ";" + sWeapon + ";" + iDamage + ";" + sMeansOfDeath + ";" + sHitLoc + "\n");
}
}

Callback_PlayerKilled(eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc)
{
self endon("spawned");

if(self.sessionteam == "spectator")
return;

// If the player was killed by a head shot, let players know it was a head shot kill
if(sHitLoc == "head" && sMeansOfDeath != "MOD_MELEE")
sMeansOfDeath = "MOD_HEAD_SHOT";

// send out an obituary message to all clients about the kill
obituary(self, attacker, sWeapon, sMeansOfDeath);

self.sessionstate = "dead";
self.statusicon = "gfx/hud/hud@status_dead.tga";
self.headicon = "";
if (!isdefined (self.autobalance))
{
self.pers["deaths"]++;
self.deaths = self.pers["deaths"];
}

lpselfnum = self getEntityNumber();
lpselfguid = self getGuid();
lpselfname = self.name;
lpselfteam = self.pers["team"];
lpattackerteam = "";

attackerNum = -1;

if(isPlayer(attacker))
{
if(attacker == self) // killed himself
{
doKillcam = false;
if (!isdefined (self.autobalance))
{
attacker.pers["score"]--;
attacker.score = attacker.pers["score"];
}

if(isDefined(attacker.friendlydamage))
clientAnnouncement(attacker, &"MPSCRIPT_FRIENDLY_FIRE_WILL_NOT");
}
else
{
attackerNum = attacker getEntityNumber();
doKillcam = true;

if(self.pers["team"] == attacker.pers["team"]) // killed by a friendly
{
attacker.pers["score"]--;
attacker.score = attacker.pers["score"];
}
else
{
attacker.pers["score"]++;
attacker.score = attacker.pers["score"];
}
}

lpattacknum = attacker getEntityNumber();
lpattackguid = attacker getGuid();
lpattackname = attacker.name;
lpattackerteam = attacker.pers["team"];
}
else // If you weren't killed by a player, you were in the wrong place at the wrong time
{
doKillcam = false;

self.pers["score"]--;
self.score = self.pers["score"];

lpattacknum = -1;
lpattackguid = "";
lpattackname = "";
lpattackerteam = "world";
Ground ZerO
logPrint("K;" + lpselfguid + ";" + lpselfnum + ";" + lpselfteam + ";" + lpselfname + ";" + lpattackguid + ";" + lpattacknum + ";" + lpattackerteam + ";" + lpattackname + ";" + sWeapon + ";" + iDamage + ";" + sMeansOfDeath + ";" + sHitLoc + "\n");

// Make the player drop his weapon
if (!isdefined (self.autobalance))
self dropItem(self getcurrentweapon());

self.pers["weapon1"] = undefined;
self.pers["weapon2"] = undefined;
self.pers["spawnweapon"] = undefined;

if (!isdefined (self.autobalance))
body = self cloneplayer();
self.autobalance = undefined;

updateTeamStatus();

// TODO: Add additional checks that allow killcam when the last player killed wouldn't end the round (bomb is planted)
if((getCvarInt("scr_killcam") <= 0) || !level.exist[self.pers["team"]]) // If the last player on a team was just killed, don't do killcam
doKillcam = false;

delay = 2; // Delay the player becoming a spectator till after he's done dying
wait delay; // ?? Also required for Callback_PlayerKilled to complete before killcam can execute

if(doKillcam && !level.roundended)
self thread killcam(attackerNum, delay);
else
{
currentorigin = self.origin;
currentangles = self.angles;

self thread spawnSpectator(currentorigin + (0, 0, 60), currentangles);
}
}

spawnPlayer()
{
self notify("spawned");

resettimeout();

self.sessionteam = self.pers["team"];
self.spectatorclient = -1;
self.archivetime = 0;
self.friendlydamage = undefined;

if(isDefined(self.spawned))
return;

self.sessionstate = "playing";

if(self.pers["team"] == "allies")
spawnpointname = "mp_searchanddestroy_spawn_allied";
else
spawnpointname = "mp_searchanddestroy_spawn_axis";

spawnpoints = getentarray(spawnpointname, "classname");
spawnpoint = maps\mp\gametypes\_spawnlogic::getSpawnpoint_Random(spawnpoints);

if(isDefined(spawnpoint))
self spawn(spawnpoint.origin, spawnpoint.angles);
else
maps\mp\_utility::error("NO " + spawnpointname + " SPAWNPOINTS IN MAP");

self.spawned = true;
self.statusicon = "";
self.maxhealth = 100;
self.health = self.maxhealth;

updateTeamStatus();

if(!isDefined(self.pers["score"]))
self.pers["score"] = 0;
self.score = self.pers["score"];

if(!isDefined(self.pers["deaths"]))
self.pers["deaths"] = 0;
self.deaths = self.pers["deaths"];

if(!isDefined(self.pers["savedmodel"]))
maps\mp\gametypes\_teams::model();
else
maps\mp\_utility::loadModel(self.pers["savedmodel"]);

if(isDefined(self.pers["weapon1"]) && isDefined(self.pers["weapon2"]))
{
self setWeaponSlotWeapon("primary", self.pers["weapon1"]);
self setWeaponSlotAmmo("primary", 999);
self setWeaponSlotClipAmmo("primary", 999);

self setWeaponSlotWeapon("primaryb", self.pers["weapon2"]);
self setWeaponSlotAmmo("primaryb", 999);
self setWeaponSlotClipAmmo("primaryb", 999);

self setSpawnWeapon(self.pers["spawnweapon"]);
}
else
{
self setWeaponSlotWeapon("primary", self.pers["weapon"]);
self setWeaponSlotAmmo("primary", 999);
self setWeaponSlotClipAmmo("primary", 999);

self setSpawnWeapon(self.pers["weapon"]);
}

maps\mp\gametypes\_teams::givePistol();
maps\mp\gametypes\_teams::giveGrenades(self.pers["selectedweapon"]);

self.usedweapons = false;
thread maps\mp\gametypes\_teams::watchWeaponUsage();

if(self.pers["team"] == game["attackers"])
self setClientCvar("cg_objectiveText", &"SD_OBJ_ATTACKERS");
else if(self.pers["team"] == game["defenders"])
self setClientCvar("cg_objectiveText", &"SD_OBJ_DEFENDERS");

if(level.drawfriend)
{
if(self.pers["team"] == "allies")
{
self.headicon = game["headicon_allies"];
self.headiconteam = "allies";
}
else
{
self.headicon = game["headicon_axis"];
self.headiconteam = "axis";
}
}
}

spawnSpectator(origin, angles)
{
self notify("spawned");

resettimeout();

self.sessionstate = "spectator";
self.spectatorclient = -1;
self.archivetime = 0;
self.friendlydamage = undefined;

if(self.pers["team"] == "spectator")
self.statusicon = "";

maps\mp\gametypes\_teams::SetSpectatePermissions();

if(isDefined(origin) && isDefined(angles))
self spawn(origin, angles);
else
{
spawnpointname = "mp_searchanddestroy_intermission";
spawnpoints = getentarray(spawnpointname, "classname");
spawnpoint = maps\mp\gametypes\_spawnlogic::getSpawnpoint_Random(spawnpoints);

if(isDefined(spawnpoint))
self spawn(spawnpoint.origin, spawnpoint.angles);
else
maps\mp\_utility::error("NO " + spawnpointname + " SPAWNPOINTS IN MAP");
}

updateTeamStatus();

self.usedweapons = false;

if(game["attackers"] == "allies")
self setClientCvar("cg_objectiveText", &"SD_OBJ_SPECTATOR_ALLIESATTACKING");
else if(game["attackers"] == "axis")
self setClientCvar("cg_objectiveText", &"SD_OBJ_SPECTATOR_AXISATTACKING");
}

spawnIntermission()
{
self notify("spawned");

resettimeout();

self.sessionstate = "intermission";
self.spectatorclient = -1;
self.archivetime = 0;
self.friendlydamage = undefined;

spawnpointname = "mp_searchanddestroy_intermission";
spawnpoints = getentarray(spawnpointname, "classname");
spawnpoint = maps\mp\gametypes\_spawnlogic::getSpawnpoint_Random(spawnpoints);

if(isDefined(spawnpoint))
self spawn(spawnpoint.origin, spawnpoint.angles);
else
maps\mp\_utility::error("NO " + spawnpointname + " SPAWNPOINTS IN MAP");
}

killcam(attackerNum, delay)
{
self endon("spawned");

// killcam
if(attackerNum < 0)
return;

self.sessionstate = "spectator";
self.spectatorclient = attackerNum;
self.archivetime = delay + 7;

maps\mp\gametypes\_teams::SetKillcamSpectatePermissions();

// wait till the next server frame to allow code a chance to update archivetime if it needs trimming
wait 0.05;

if(self.archivetime <= delay)
{
self.spectatorclient = -1;
self.archivetime = 0;

maps\mp\gametypes\_teams::SetSpectatePermissions();
return;
}

self.killcam = true;

if(!isDefined(self.kc_topbar))
{
self.kc_topbar = newClientHudElem(self);
self.kc_topbar.archived = false;
self.kc_topbar.x = 0;
self.kc_topbar.y = 0;
self.kc_topbar.alpha = 0.5;
self.kc_topbar setShader("black", 640, 112);
}

if(!isDefined(self.kc_bottombar))
{
self.kc_bottombar = newClientHudElem(self);
self.kc_bottombar.archived = false;
self.kc_bottombar.x = 0;
self.kc_bottombar.y = 368;
self.kc_bottombar.alpha = 0.5;
self.kc_bottombar setShader("black", 640, 112);
}

if(!isDefined(self.kc_title))
{
self.kc_title = newClientHudElem(self);
self.kc_title.archived = false;
self.kc_title.x = 320;
self.kc_title.y = 40;
self.kc_title.alignX = "center";
self.kc_title.alignY = "middle";
self.kc_title.sort = 1; // force to draw after the bars
self.kc_title.fontScale = 3.5;
}
self.kc_title setText(&"MPSCRIPT_KILLCAM");

if(!isDefined(self.kc_skiptext))
{
self.kc_skiptext = newClientHudElem(self);
self.kc_skiptext.archived = false;
self.kc_skiptext.x = 320;
self.kc_skiptext.y = 70;
self.kc_skiptext.alignX = "center";
self.kc_skiptext.alignY = "middle";
self.kc_skiptext.sort = 1; // force to draw after the bars
}
self.kc_skiptext setText(&"MPSCRIPT_PRESS_ACTIVATE_TO_SKIP");

if(!isDefined(self.kc_timer))
{
self.kc_timer = newClientHudElem(self);
self.kc_timer.archived = false;
self.kc_timer.x = 320;
self.kc_timer.y = 428;
self.kc_timer.alignX = "center";
self.kc_timer.alignY = "middle";
self.kc_timer.fontScale = 3.5;
self.kc_timer.sort = 1;
}
self.kc_timer setTenthsTimer(self.archivetime - delay);

self thread spawnedKillcamCleanup();
self thread waitSkipKillcamButton();
self thread waitKillcamTime();
self waittill("end_killcam");

self removeKillcamElements();

self.spectatorclient = -1;
self.archivetime = 0;
self.killcam = undefined;

maps\mp\gametypes\_teams::SetSpectatePermissions();
}

waitKillcamTime()
{
self endon("end_killcam");

wait(self.archivetime - 0.05);
self notify("end_killcam");
}

waitSkipKillcamButton()
{
self endon("end_killcam");

while(self useButtonPressed())
wait .05;

while(!(self useButtonPressed()))
wait .05;

self notify("end_killcam");
}

removeKillcamElements()
{
if(isDefined(self.kc_topbar))
self.kc_topbar destroy();
if(isDefined(self.kc_bottombar))
self.kc_bottombar destroy();
if(isDefined(self.kc_title))
self.kc_title destroy();
if(isDefined(self.kc_skiptext))
self.kc_skiptext destroy();
if(isDefined(self.kc_timer))
self.kc_timer destroy();
}

spawnedKillcamCleanup()
{
self endon("end_killcam");

self waittill("spawned");
self removeKillcamElements();
}

startGame()
{
level.starttime = getTime();
thread startRound();

if ( (level.teambalance > 0) && (!game["BalanceTeamsNextRound"]) )
level thread maps\mp\gametypes\_teams::TeamBalance_Check_Roundbased();
}

startRound()
{
level endon("bomb_planted");

thread maps\mp\gametypes\_teams::sayMoveIn();

level.clock = newHudElem();
level.clock.x = 320;
level.clock.y = 460;
level.clock.alignX = "center";
level.clock.alignY = "middle";
level.clock.font = "bigfixed";
level.clock setTimer(level.roundlength * 60);

if(game["matchstarted"])
{
level.clock.color = (0, 1, 0);

if((level.roundlength * 60) > level.graceperiod)
{
wait level.graceperiod;

level notify("round_started");
level.roundstarted = true;
level.clock.color = (1, 1, 1);

// Players on a team but without a weapon show as dead since they can not get in this round
players = getentarray("player", "classname");
for(i = 0; i < players.size; i++)
{
player = players[i];

if(player.sessionteam != "spectator" && !isDefined(player.pers["weapon"]))
player.statusicon = "gfx/hud/hud@status_dead.tga";
}

wait((level.roundlength * 60) - level.graceperiod);
}
else
wait(level.roundlength * 60);
}
else
{
level.clock.color = (1, 1, 1);
wait(level.roundlength * 60);
}

if(level.roundended)
return;

if(!level.exist[game["attackers"]] || !level.exist[game["defenders"]])
{
announcement(&"SD_TIMEHASEXPIRED");
level thread endRound("draw");
return;
}

announcement(&"SD_TIMEHASEXPIRED");
level thread endRound(game["defenders"]);
}

checkMatchStart()
{
oldvalue["teams"] = level.exist["teams"];
level.exist["teams"] = false;

// If teams currently exist
if(level.exist["allies"] && level.exist["axis"])
level.exist["teams"] = true;

// If teams previously did not exist and now they do
if(!oldvalue["teams"] && level.exist["teams"])
{
if(!game["matchstarted"])
{
announcement(&"SD_MATCHSTARTING");

level notify("kill_endround");
level.roundended = false;
level thread endRound("reset");
}
else
{
announcement(&"SD_MATCHRESUMING");

level notify("kill_endround");
level.roundended = false;
level thread endRound("draw");
}

return;
}
}
Ground ZerO
resetScores()
{
players = getentarray("player", "classname");
for(i = 0; i < players.size; i++)
{
player = players[i];
player.pers["score"] = 0;
player.pers["deaths"] = 0;
}

game["alliedscore"] = 0;
setTeamScore("allies", game["alliedscore"]);
game["axisscore"] = 0;
setTeamScore("axis", game["axisscore"]);
}

endRound(roundwinner)
{
level endon("kill_endround");

if(level.roundended)
return;
level.roundended = true;

// End bombzone threads and remove related hud elements and objectives
level notify("round_ended");

players = getentarray("player", "classname");
for(i = 0; i < players.size; i++)
{
player = players[i];

if (getCvar("g_autodemo") == "1")
player autoDemoStop();

if (getCvar("g_autoscreenshot") == "1")
player autoScreenshot();

if(isDefined(player.planticon))
player.planticon destroy();

if(isDefined(player.defuseicon))
player.defuseicon destroy();

if(isDefined(player.progressbackground))
player.progressbackground destroy();

if(isDefined(player.progressbar))
player.progressbar destroy();

player unlink();
player enableWeapon();
}

objective_delete(0);
objective_delete(1);

if(roundwinner == "allies")
{
players = getentarray("player", "classname");
for(i = 0; i < players.size; i++)
players[i] playLocalSound("MP_announcer_allies_win");
}
else if(roundwinner == "axis")
{
players = getentarray("player", "classname");
for(i = 0; i < players.size; i++)
players[i] playLocalSound("MP_announcer_axis_win");
}
else if(roundwinner == "draw")
{
players = getentarray("player", "classname");
for(i = 0; i < players.size; i++)
players[i] playLocalSound("MP_announcer_round_draw");
}

wait 5;

winners = "";
losers = "";

if(roundwinner == "allies")
{
game["alliedscore"]++;
setTeamScore("allies", game["alliedscore"]);

players = getentarray("player", "classname");
for(i = 0; i < players.size; i++)
{
lpGuid = players[i] getGuid();
if((isdefined(players[i].pers["team"])) && (players[i].pers["team"] == "allies"))
winners = (winners + ";" + lpGuid + ";" + players[i].name);
else if((isdefined(players[i].pers["team"])) && (players[i].pers["team"] == "axis"))
losers = (losers + ";" + lpGuid + ";" + players[i].name);
}
logPrint("W;allies" + winners + "\n");
logPrint("L;axis" + losers + "\n");
}
else if(roundwinner == "axis")
{
game["axisscore"]++;
setTeamScore("axis", game["axisscore"]);

players = getentarray("player", "classname");
for(i = 0; i < players.size; i++)
{
lpGuid = players[i] getGuid();
if((isdefined(players[i].pers["team"])) && (players[i].pers["team"] == "axis"))
winners = (winners + ";" + lpGuid + ";" + players[i].name);
else if((isdefined(players[i].pers["team"])) && (players[i].pers["team"] == "allies"))
losers = (losers + ";" + lpGuid + ";" + players[i].name);
}
logPrint("W;axis" + winners + "\n");
logPrint("L;allies" + losers + "\n");
}

if(game["matchstarted"])
{
checkScoreLimit();
game["roundsplayed"]++;
checkRoundLimit();
}

if(!game["matchstarted"] && roundwinner == "reset")
{
game["matchstarted"] = true;
thread resetScores();
game["roundsplayed"] = 0;
}

game["timepassed"] = game["timepassed"] + ((getTime() - level.starttime) / 1000) / 60.0;

checkTimeLimit();

if(level.mapended)
return;
level.mapended = true;

// for all living players store their weapons
players = getentarray("player", "classname");
for(i = 0; i < players.size; i++)
{
player = players[i];

if(isDefined(player.pers["team"]) && player.pers["team"] != "spectator" && player.sessionstate == "playing")
{
primary = player getWeaponSlotWeapon("primary");
primaryb = player getWeaponSlotWeapon("primaryb");

// If a menu selection was made
if(isDefined(player.oldweapon))
{
// If a new weapon has since been picked up (this fails when a player picks up a weapon the same as his original)
if(player.oldweapon != primary && player.oldweapon != primaryb && primary != "none")
{
player.pers["weapon1"] = primary;
player.pers["weapon2"] = primaryb;
player.pers["spawnweapon"] = player getCurrentWeapon();
} // If the player's menu chosen weapon is the same as what is in the primaryb slot, swap the slots
else if(player.pers["weapon"] == primaryb)
{
player.pers["weapon1"] = primaryb;
player.pers["weapon2"] = primary;
player.pers["spawnweapon"] = player.pers["weapon1"];
} // Give them the weapon they chose from the menu
else
{
player.pers["weapon1"] = player.pers["weapon"];
player.pers["weapon2"] = primaryb;
player.pers["spawnweapon"] = player.pers["weapon1"];
}
} // No menu choice was ever made, so keep their weapons and spawn them with what they're holding, unless it's a pistol or grenade
else
{
if(primary == "none")
player.pers["weapon1"] = player.pers["weapon"];
else
player.pers["weapon1"] = primary;

player.pers["weapon2"] = primaryb;

spawnweapon = player getCurrentWeapon();
if ( (spawnweapon == "none") && (isdefined (primary)) )
spawnweapon = primary;

if(!maps\mp\gametypes\_teams::isPistolOrGrenade(spawnweapon))
player.pers["spawnweapon"] = spawnweapon;
else
player.pers["spawnweapon"] = player.pers["weapon1"];
}
}
}

if ( (level.teambalance > 0) && (game["BalanceTeamsNextRound"]) )
{
level.lockteams = true;
level thread maps\mp\gametypes\_teams::TeamBalance();
level waittill ("Teams Balanced");
wait 4;
}
map_restart(true);
}

endMap()
{
game["state"] = "intermission";
level notify("intermission");

if(isdefined(level.bombmodel))
level.bombmodel stopLoopSound();

if(game["alliedscore"] == game["axisscore"])
text = &"MPSCRIPT_THE_GAME_IS_A_TIE";
else if(game["alliedscore"] > game["axisscore"])
text = &"MPSCRIPT_ALLIES_WIN";
else
text = &"MPSCRIPT_AXIS_WIN";

players = getentarray("player", "classname");
for(i = 0; i < players.size; i++)
{
player = players[i];

player closeMenu();
player setClientCvar("g_scriptMainMenu", "main");
player setClientCvar("cg_objectiveText", text);
player spawnIntermission();
}

wait 10;
exitLevel(false);
}

checkTimeLimit()
{
if(level.timelimit <= 0)
return;

if(game["timepassed"] < level.timelimit)
return;

if(level.mapended)
return;
level.mapended = true;

iprintln(&"MPSCRIPT_TIME_LIMIT_REACHED");
level thread endMap();
}

checkScoreLimit()
{
if(level.scorelimit <= 0)
return;

if(game["alliedscore"] < level.scorelimit && game["axisscore"] < level.scorelimit)
return;

if(level.mapended)
return;
level.mapended = true;

iprintln(&"MPSCRIPT_SCORE_LIMIT_REACHED");
level thread endMap();
}

checkRoundLimit()
{
if(level.roundlimit <= 0)
return;

if(game["roundsplayed"] < level.roundlimit)
return;

if(level.mapended)
return;
level.mapended = true;

iprintln(&"MPSCRIPT_ROUND_LIMIT_REACHED");
level thread endMap();
}

updateGametypeCvars()
{
level endon("PAMEnabled");

for(;;)
{
// WORM PAM Enable Check
pamenable = getCvarint("svr_pamenable");
if (level.pamenable != pamenable)
{
level.pamenable = pamenable;
//iprintln("^2PAM has been turned ON!");
//iprintln("^2MAP_ROTATE is required");

maps\mp\gametypes\_pam_utilities::StartPAMUO("enable");

level notify("PAMEnabled");

}
// End Worm PAM Enable Check

timelimit = getCvarFloat("scr_sd_timelimit");
if(level.timelimit != timelimit)
{
if(timelimit > 1440)
{
timelimit = 1440;
setCvar("scr_sd_timelimit", "1440");
}

level.timelimit = timelimit;
setCvar("ui_sd_timelimit", level.timelimit);
}

scorelimit = getCvarInt("scr_sd_scorelimit");
if(level.scorelimit != scorelimit)
{
level.scorelimit = scorelimit;
setCvar("ui_sd_scorelimit", level.scorelimit);

if(game["matchstarted"])
checkScoreLimit();
}

roundlimit = getCvarInt("scr_sd_roundlimit");
if(level.roundlimit != roundlimit)
{
level.roundlimit = roundlimit;
setCvar("ui_sd_roundlimit", level.roundlimit);

if(game["matchstarted"])
checkRoundLimit();
}

roundlength = getCvarFloat("scr_sd_roundlength");
if(roundlength > 10)
setCvar("scr_sd_roundlength", "10");

graceperiod = getCvarFloat("scr_sd_graceperiod");
if(graceperiod > 60)
setCvar("scr_sd_graceperiod", "60");

drawfriend = getCvarFloat("scr_drawfriend");
if(level.drawfriend != drawfriend)
{
level.drawfriend = drawfriend;

if(level.drawfriend)
{
// for all living players, show the appropriate headicon
players = getentarray("player", "classname");
for(i = 0; i < players.size; i++)
{
player = players[i];

if(isDefined(player.pers["team"]) && player.pers["team"] != "spectator" && player.sessionstate == "playing")
{
if(player.pers["team"] == "allies")
{
player.headicon = game["headicon_allies"];
player.headiconteam = "allies";
}
else
{
player.headicon = game["headicon_axis"];
player.headiconteam = "axis";
}
}
}
}
else
{
players = getentarray("player", "classname");
for(i = 0; i < players.size; i++)
{
player = players[i];

if(isDefined(player.pers["team"]) && player.pers["team"] != "spectator" && player.sessionstate == "playing")
player.headicon = "";
}
}
}

killcam = getCvarInt("scr_killcam");
if (level.killcam != killcam)
{
level.killcam = getCvarInt("scr_killcam");
if(level.killcam >= 1)
setarchive(true);
else
setarchive(false);
}

freelook = getCvarInt("scr_freelook");
if (level.allowfreelook != freelook)
{
level.allowfreelook = getCvarInt("scr_freelook");
level maps\mp\gametypes\_teams::UpdateSpectatePermissions();
}

enemyspectate = getCvarInt("scr_spectateenemy");
if (level.allowenemyspectate != enemyspectate)
{
level.allowenemyspectate = getCvarInt("scr_spectateenemy");
level maps\mp\gametypes\_teams::UpdateSpectatePermissions();
}

teambalance = getCvarInt("scr_teambalance");
if (level.teambalance != teambalance)
{
level.teambalance = getCvarInt("scr_teambalance");
if (level.teambalance > 0)
level thread maps\mp\gametypes\_teams::TeamBalance_Check_Roundbased();
}

wait 1;
}
}

updateTeamStatus()
{
wait 0; // Required for Callback_PlayerDisconnect to complete before updateTeamStatus can execute

resettimeout();

oldvalue["allies"] = level.exist["allies"];
oldvalue["axis"] = level.exist["axis"];
level.exist["allies"] = 0;
level.exist["axis"] = 0;

players = getentarray("player", "classname");
for(i = 0; i < players.size; i++)
{
player = players[i];

if(isDefined(player.pers["team"]) && player.pers["team"] != "spectator" && player.sessionstate == "playing")
level.exist[player.pers["team"]]++;
}

if(level.exist["allies"])
level.didexist["allies"] = true;
if(level.exist["axis"])
level.didexist["axis"] = true;

if(level.roundended)
return;

if(oldvalue["allies"] && !level.exist["allies"] && oldvalue["axis"] && !level.exist["axis"])
{
if(!level.bombplanted)
{
announcement(&"SD_ROUNDDRAW");
level thread endRound("draw");
return;
}

if(game["attackers"] == "allies")
{
announcement(&"SD_ALLIEDMISSIONACCOMPLISHED");
level thread endRound("allies");
return;
}

announcement(&"SD_AXISMISSIONACCOMPLISHED");
level thread endRound("axis");
return;
}

if(oldvalue["allies"] && !level.exist["allies"])
{
// no bomb planted, axis win
if(!level.bombplanted)
{
announcement(&"SD_ALLIESHAVEBEENELIMINATED");
level thread endRound("axis");
return;
}

if(game["attackers"] == "allies")
return;

// allies just died and axis have planted the bomb
if(level.exist["axis"])
{
announcement(&"SD_ALLIESHAVEBEENELIMINATED");
level thread endRound("axis");
return;
}

announcement(&"SD_AXISMISSIONACCOMPLISHED");
level thread endRound("axis");
return;
}

if(oldvalue["axis"] && !level.exist["axis"])
{
// no bomb planted, allies win
if(!level.bombplanted)
{
announcement(&"SD_AXISHAVEBEENELIMINATED");
level thread endRound("allies");
return;
}

if(game["attackers"] == "axis")
return;

// axis just died and allies have planted the bomb
if(level.exist["allies"])
{
announcement(&"SD_AXISHAVEBEENELIMINATED");
level thread endRound("allies");
return;
}

announcement(&"SD_ALLIEDMISSIONACCOMPLISHED");
level thread endRound("allies");
return;
}
}

bombzones()
{
level.barsize = 288;
level.planttime = 5; // seconds to plant a bomb
level.defusetime = 10; // seconds to defuse a bomb

bombtrigger = getent("bombtrigger", "targetname");
bombtrigger maps\mp\_utility::triggerOff();

bombzone_A = getent("bombzone_A", "targetname");
bombzone_B = getent("bombzone_B", "targetname");
bombzone_A thread bombzone_think(bombzone_B);
bombzone_B thread bombzone_think(bombzone_A);

wait 1; // TEMP: without this one of the objective icon is the default. Carl says we're overflowing something.
objective_add(0, "current", bombzone_A.origin, "gfx/hud/hud@objectiveA.tga");
objective_add(1, "current", bombzone_B.origin, "gfx/hud/hud@objectiveB.tga");
}

bombzone_think(bombzone_other)
{
level endon("round_ended");

level.barincrement = (level.barsize / (20.0 * level.planttime));

for(;;)
{
self waittill("trigger", other);

if(isDefined(bombzone_other.planting))
{
if(isDefined(other.planticon))
other.planticon destroy();

continue;
}

if(isPlayer(other) && (other.pers["team"] == game["attackers"]) && other isOnGround())
{
if(!isDefined(other.planticon))
{
other.planticon = newClientHudElem(other);
other.planticon.alignX = "center";
other.planticon.alignY = "middle";
other.planticon.x = 320;
other.planticon.y = 345;
other.planticon setShader("ui_mp/assets/hud@plantbomb.tga", 64, 64);
}

while(other istouching(self) && isAlive(other) && other useButtonPressed())
{
other notify("kill_check_bombzone");

self.planting = true;
Ground ZerO
if(!isDefined(other.progressbackground))
{
other.progressbackground = newClientHudElem(other);
other.progressbackground.alignX = "center";
other.progressbackground.alignY = "middle";
other.progressbackground.x = 320;
other.progressbackground.y = 385;
other.progressbackground.alpha = 0.5;
}
other.progressbackground setShader("black", (level.barsize + 4), 12);

if(!isDefined(other.progressbar))
{
other.progressbar = newClientHudElem(other);
other.progressbar.alignX = "left";
other.progressbar.alignY = "middle";
other.progressbar.x = (320 - (level.barsize / 2.0));
other.progressbar.y = 385;
}
other.progressbar setShader("white", 0, 8);
other.progressbar scaleOverTime(level.planttime, level.barsize, 8);

other playsound("MP_bomb_plant");
other linkTo(self);
other disableWeapon();

self.progresstime = 0;
while(isAlive(other) && other useButtonPressed() && (self.progresstime < level.planttime))
{
self.progresstime += 0.05;
wait 0.05;
}

if(isDefined(other.progressbackground))
other.progressbackground destroy();
if(isDefined(other.progressbar))
other.progressbar destroy();

if(self.progresstime >= level.planttime)
{
if(isDefined(other.planticon))
other.planticon destroy();

other enableWeapon();

level.bombexploder = self.script_noteworthy;

bombzone_A = getent("bombzone_A", "targetname");
bombzone_B = getent("bombzone_B", "targetname");
bombzone_A delete();
bombzone_B delete();
objective_delete(0);
objective_delete(1);

plant = other maps\mp\_utility::getPlant();

level.bombmodel = spawn("script_model", plant.origin);
level.bombmodel.angles = plant.angles;
level.bombmodel setmodel("xmodel/mp_bomb1_defuse");
level.bombmodel playSound("Explo_plant_no_tick");

bombtrigger = getent("bombtrigger", "targetname");
bombtrigger.origin = level.bombmodel.origin;

objective_add(0, "current", bombtrigger.origin, "gfx/hud/hud@bombplanted.tga");

level.bombplanted = true;

lpselfnum = other getEntityNumber();
lpselfguid = other getGuid();
logPrint("A;" + lpselfguid + ";" + lpselfnum + ";" + game["attackers"] + ";" + other.name + ";" + "bomb_plant" + "\n");

announcement(&"SD_EXPLOSIVESPLANTED");

players = getentarray("player", "classname");
for(i = 0; i < players.size; i++)
players[i] playLocalSound("MP_announcer_bomb_planted");

bombtrigger thread bomb_think();
bombtrigger thread bomb_countdown();

level notify("bomb_planted");
level.clock destroy();

return; //TEMP, script should stop after the wait .05
}
else
{
other unlink();
other enableWeapon();
}

wait .05;
}

self.planting = undefined;
other thread check_bombzone(self);
}
}
}

check_bombzone(trigger)
{
self notify("kill_check_bombzone");
self endon("kill_check_bombzone");
level endon("round_ended");

while(isDefined(trigger) && !isDefined(trigger.planting) && self istouching(trigger) && isAlive(self))
wait 0.05;

if(isDefined(self.planticon))
self.planticon destroy();
}

bomb_countdown()
{
self endon("bomb_defused");
level endon("intermission");

level.bombmodel playLoopSound("bomb_tick");

// set the countdown time
countdowntime = 60;

wait countdowntime;

// bomb timer is up
objective_delete(0);

level.bombexploded = true;
self notify("bomb_exploded");

// trigger exploder if it exists
if(isDefined(level.bombexploder))
maps\mp\_utility::exploder(level.bombexploder);

// explode bomb
origin = self getorigin();
range = 500;
maxdamage = 2000;
mindamage = 1000;

self delete(); // delete the defuse trigger
level.bombmodel stopLoopSound();
level.bombmodel delete();

playfx(level._effect["bombexplosion"], origin);
radiusDamage(origin, range, maxdamage, mindamage);

level thread endRound(game["attackers"]);
}

bomb_think()
{
self endon("bomb_exploded");
level.barincrement = (level.barsize / (20.0 * level.defusetime));

for(;;)
{
self waittill("trigger", other);

// check for having been triggered by a valid player
if(isPlayer(other) && (other.pers["team"] == game["defenders"]) && other isOnGround())
{
if(!isDefined(other.defuseicon))
{
other.defuseicon = newClientHudElem(other);
other.defuseicon.alignX = "center";
other.defuseicon.alignY = "middle";
other.defuseicon.x = 320;
other.defuseicon.y = 345;
other.defuseicon setShader("ui_mp/assets/hud@defusebomb.tga", 64, 64);
}

while(other islookingat(self) && distance(other.origin, self.origin) < 64 && isAlive(other) && other useButtonPressed())
{
other notify("kill_check_bomb");

if(!isDefined(other.progressbackground))
{
other.progressbackground = newClientHudElem(other);
other.progressbackground.alignX = "center";
other.progressbackground.alignY = "middle";
other.progressbackground.x = 320;
other.progressbackground.y = 385;
other.progressbackground.alpha = 0.5;
}
other.progressbackground setShader("black", (level.barsize + 4), 12);

if(!isDefined(other.progressbar))
{
other.progressbar = newClientHudElem(other);
other.progressbar.alignX = "left";
other.progressbar.alignY = "middle";
other.progressbar.x = (320 - (level.barsize / 2.0));
other.progressbar.y = 385;
}
other.progressbar setShader("white", 0, 8);
other.progressbar scaleOverTime(level.defusetime, level.barsize, 8);

other playsound("MP_bomb_defuse");
other linkTo(self);
other disableWeapon();

self.progresstime = 0;
while(isAlive(other) && other useButtonPressed() && (self.progresstime < level.defusetime))
{
self.progresstime += 0.05;
wait 0.05;
}

if(isDefined(other.progressbackground))
other.progressbackground destroy();
if(isDefined(other.progressbar))
other.progressbar destroy();

if(self.progresstime >= level.defusetime)
{
if(isDefined(other.defuseicon))
other.defuseicon destroy();

objective_delete(0);

self notify("bomb_defused");
level.bombmodel setmodel("xmodel/mp_bomb1");
level.bombmodel stopLoopSound();
self delete();

announcement(&"SD_EXPLOSIVESDEFUSED");

lpselfnum = other getEntityNumber();
lpselfguid = other getGuid();
logPrint("A;" + lpselfguid + ";" + lpselfnum + ";" + game["defenders"] + ";" + other.name + ";" + "bomb_defuse" + "\n");

players = getentarray("player", "classname");
for(i = 0; i < players.size; i++)
players[i] playLocalSound("MP_announcer_bomb_defused");

level thread endRound(game["defenders"]);
return; //TEMP, script should stop after the wait .05
}
else
{
other unlink();
other enableWeapon();
}

wait .05;
}

self.defusing = undefined;
other thread check_bomb(self);
}
}
}

check_bomb(trigger)
{
self notify("kill_check_bomb");
self endon("kill_check_bomb");

while(isDefined(trigger) && !isDefined(trigger.defusing) && distance(self.origin, trigger.origin) < 32 && self islookingat(trigger) && isAlive(self))
wait 0.05;

if(isDefined(self.defuseicon))
self.defuseicon destroy();
}

printJoinedTeam(team)
{
if(team == "allies")
iprintln(&"MPSCRIPT_JOINED_ALLIES", self);
else if(team == "axis")
iprintln(&"MPSCRIPT_JOINED_AXIS", self);
}

addBotClients()
{
wait 5;

for(i = 0; i < 2; i++)
{
ent[i] = addtestclient();
wait 0.5;

if(isPlayer(ent[i]))
{
if(i & 1)
{
ent[i] notify("menuresponse", game["menu_team"], "axis");
wait 0.5;
ent[i] notify("menuresponse", game["menu_weapon_axis"], "kar98k_mp");
}
else
{
ent[i] notify("menuresponse", game["menu_team"], "allies");
wait 0.5;
ent[i] notify("menuresponse", game["menu_weapon_allies"], "m1garand_mp");
}
}
}
}
Ground ZerO
sorry aber ist so groß^^
Private Joker
Oha hätte nie gedacht das die so Umfangreich ist geschockt

Hast du irgendwas von der Config verändert gehabt? Oder eine andere genommen als die die dabei war?

Im Notfall vieleicht mal schaun nach neuerer Version / Bugfixes für deine Version vieleicht hilft das ja auch weiter...

Junge Junge die ist echt groß smile
Ground ZerO
also daran geändert habe ich nichts, aber ich habe eben eine andere hochgeladen die aber mit dem befehl: /rcon pam_mode esl nicht anspringen...


hat keiner ne einfache und effektive lösung BITTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTE verwirrt