1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
|
GetSecondaryWeapon() {
self endon("disconnect");
self endon("killed_player");
if(game["am_secondary_weapon"] != 1) return;
if(game["am_error_logfile"] == 1) logPrint("GetSecondaryWeapon\n");
// * Wenn Weapon Arsenal aktiviert, dann muß für das WeaponLimit die 1. ausgewählte Waffe bereits im Arsenal sein *
// * Die wird nur zum jetzigen zählen verwendet, diese wird weiter unten dann wieder gelöscht bevor das Arsenal aktiv wird *
if(game["am_weapon_arsenal"] == 1) {
self.pers["weapon_count"] = 1;
self.pers["weapons"][0] = self getWeaponSlotWeapon("primary");
// * Waffen Limits Check und Limitation *
self maps\mp\gametypes\_admiral_mod_weapons::MakeWeaponLimit();
self.pers["weapon_count"] = 0;
self.pers["weapons"] = undefined;
}
if(isDefined(self.pers["team_old"]) && self.pers["team_old"] != self.pers["team"] || !isDefined(self.pers["team_old"])) {
self.pers["team_old"] = self.pers["team"];
self.pers["old_secondary_weapon"] = undefined;
}
if(!isDefined(self.pers["am_weapon_changed"])) {
// * Wenn Primäre Waffe nicht gewechselt wurde, dann die schon mal als Secondary Weapon ausgewählte Waffe als 2. geben *
if(isDefined(self.pers["old_secondary_weapon"])) {
self setWeaponSlotWeapon("primaryb", self.pers["old_secondary_weapon"]);
self setWeaponSlotAmmo("primaryb", 999);
self setWeaponSlotClipAmmo("primaryb", 999);
}
return;
}
self.pers["am_weapon_changed"] = undefined;
// * für Vergleich *
primaryweapon = self getWeaponSlotWeapon("primary");
if(self.pers["team"] == "allies")
{
self openMenu(game["menu_weapon_allies"]);
}
else
{
self openMenu(game["menu_weapon_axis"]);
}
self thread ShowWeaponSelectText();
while(1) {
self waittill("menuresponse", menu, response);
if(response == "open" || response == "close" || response == "changeweapon" || response == "team") return;
weapon = self maps\mp\gametypes\_weapons::restrictWeaponByServerCvars(response);
if(weapon == "restricted" || weapon == primaryweapon) {
//self openMenu(menu);
continue;
}
else {
// * wenn alles ok *
break;
}
}
self maps\mp\gametypes\_admiral_mod_hud::deletePlayerHudElementByName("secondary_weapon_top");
self maps\mp\gametypes\_admiral_mod_hud::deletePlayerHudElementByName("secondary_weapon_bottom");
self closeMenu();
self closeMenu();
wait 0.05;
self closeMenu();
// * Alte Waffe wieder herstellen *
self.pers["weapon"] = primaryweapon;
self setWeaponSlotWeapon("primary", primaryweapon);
self setWeaponSlotAmmo("primary", 999);
self setWeaponSlotClipAmmo("primary", 999);
self setSpawnWeapon(primaryweapon);
self setWeaponSlotWeapon("primaryb", weapon);
self setWeaponSlotAmmo("primaryb", 999);
self setWeaponSlotClipAmmo("primaryb", 999);
if(isDefined(weapon) && weapon != "none") self.pers["old_secondary_weapon"] = weapon;
self.pers["am_weapon_changed"] = undefined;
}
ShowWeaponSelectText() {
self endon("disconnect");
self notify("deleteSecondWeaponText");
self endon("deleteSecondWeaponText");
if(game["am_error_logfile"] == 1) logPrint("ShowWeaponSelectText\n");
// * Existierende entfernen *
self maps\mp\gametypes\_admiral_mod_hud::deletePlayerHudElementByName("secondary_weapon_top");
self maps\mp\gametypes\_admiral_mod_hud::deletePlayerHudElementByName("secondary_weapon_bottom");
self maps\mp\gametypes\_admiral_mod_hud::createPlayerTextHudElement("secondary_weapon_top", 440,80,"center","middle","fullscreen","fullscreen",true,&"MP_SECOND_WEAPON",undefined,2.2,100,1,1,1,1);
self maps\mp\gametypes\_admiral_mod_hud::createPlayerTextHudElement("secondary_weapon_bottom", 440,390,"center","middle","fullscreen","fullscreen",true,&"MP_SECOND_WEAPON",undefined,2.2,100,1,1,1,1);
wait 5;
self maps\mp\gametypes\_admiral_mod_hud::deletePlayerHudElementByName("secondary_weapon_top");
self maps\mp\gametypes\_admiral_mod_hud::deletePlayerHudElementByName("secondary_weapon_bottom");
} |