1 void() info_player_deathmatch; // needed for the other spawnpoints
2 string ColoredTeamName(float t);
4 float DistributeEvenly_amount;
5 float DistributeEvenly_totalweight;
6 void DistributeEvenly_Init(float amount, float totalweight)
8 if(DistributeEvenly_amount)
10 dprint("DistributeEvenly_Init: UNFINISHED DISTRIBUTION (", ftos(DistributeEvenly_amount), " for ");
11 dprint(ftos(DistributeEvenly_totalweight), " left!)\n");
14 DistributeEvenly_amount = 0;
16 DistributeEvenly_amount = amount;
17 DistributeEvenly_totalweight = totalweight;
19 float DistributeEvenly_Get(float weight)
24 f = floor(0.5 + DistributeEvenly_amount * weight / DistributeEvenly_totalweight);
25 DistributeEvenly_totalweight -= weight;
26 DistributeEvenly_amount -= f;
30 void move_out_of_solid_expand(entity e, vector by)
33 tracebox(e.origin, e.mins - '1 1 1' * eps, e.maxs + '1 1 1' * eps, e.origin + by, MOVE_WORLDONLY, e);
36 if(trace_fraction < 1)
39 // adjust origin in the other direction...
40 e.origin = e.origin - by * (1 - trace_fraction);
44 void move_out_of_solid(entity e)
49 traceline(o, o, MOVE_WORLDONLY, e);
52 dprint("origin is in solid too! (", vtos(o), ")");
56 tracebox(o, e.mins, e.maxs, o, MOVE_WORLDONLY, e);
64 move_out_of_solid_expand(e, '1 0 0' * m0_x); e.mins_x = m0_x;
65 move_out_of_solid_expand(e, '1 0 0' * m1_x); e.maxs_x = m1_x;
66 move_out_of_solid_expand(e, '0 1 0' * m0_y); e.mins_y = m0_y;
67 move_out_of_solid_expand(e, '0 1 0' * m1_y); e.maxs_y = m1_y;
68 move_out_of_solid_expand(e, '0 0 1' * m0_z); e.mins_z = m0_z;
69 move_out_of_solid_expand(e, '0 0 1' * m1_z); e.maxs_z = m1_z;
70 setorigin(e, e.origin);
72 tracebox(e.origin, e.mins, e.maxs, e.origin, MOVE_WORLDONLY, e);
75 dprint("could not get out of solid (", vtos(o), ")\n");
80 #define FOR_EACH_CLIENT(v) for(v = world; (v = findflags(v, flags, FL_CLIENT)) != world; )
81 #define FOR_EACH_REALCLIENT(v) FOR_EACH_CLIENT(v) if(clienttype(v) == CLIENTTYPE_REAL)
82 string STR_PLAYER = "player";
83 #define FOR_EACH_PLAYER(v) for(v = world; (v = find(v, classname, STR_PLAYER)) != world; )
84 #define FOR_EACH_REALPLAYER(v) FOR_EACH_PLAYER(v) if(clienttype(v) == CLIENTTYPE_REAL)
86 // change that to actually calling strcat when running on an engine without
87 // unlimited tempstrings:
88 // string strcat1(string s) = #115; // FRIK_FILE
89 #define strcat1(s) (s)
94 void(string s) bcenterprint
96 // TODO replace by MSG_ALL (would show it to spectators too, though)?
99 if(clienttype(head) == CLIENTTYPE_REAL)
100 centerprint(head, s);
103 void(string s, float check_dangerous) ServerConsoleEcho =
106 if (checkextension("DP_SV_PRINT"))
115 ch = substring(s, 0, 1);
116 if(ch != "\"" && ch != "\r" && ch != "\n")
118 s = substring(s, 1, strlen(s) - 1);
129 void(string s, float check_dangerous) GameLogEcho =
134 if(cvar("sv_eventlog_files"))
139 matches = cvar("sv_eventlog_files_counter") + 1;
140 cvar_set("sv_eventlog_files_counter", ftos(matches));
143 fn = strcat(substring("00000000", 0, 8 - strlen(fn)), fn);
144 fn = strcat(cvar_string("sv_eventlog_files_nameprefix"), fn, cvar_string("sv_eventlog_files_namesuffix"));
145 logfile = fopen(fn, FILE_APPEND);
148 fputs(logfile, strcat(s, "\n"));
150 if(cvar("sv_eventlog_console"))
152 ServerConsoleEcho(s, check_dangerous);
159 // will be opened later
162 void() GameLogClose =
164 if(logfile_open && logfile >= 0)
171 float math_mod(float a, float b)
173 return a - (floor(a / b) * b);
176 void relocate_spawnpoint()
178 // nudge off the floor
179 setorigin(self, self.origin + '0 0 1');
181 tracebox(self.origin, PL_MIN, PL_MAX, self.origin, TRUE, self);
182 if (trace_startsolid)
184 objerror("player spawn point in solid, mapper sucks!\n");
188 if(cvar("g_spawnpoints_autodrop"))
190 setsize(self, PL_MIN, PL_MAX);
195 #define strstr strstrofs
197 // NOTE: DO NOT USE THIS FUNCTION TOO OFTEN.
198 // IT WILL MOST PROBABLY DESTROY _ALL_ OTHER TEMP
199 // STRINGS AND TAKE QUITE LONG. haystack and needle MUST
200 // BE CONSTANT OR strzoneD!
201 float(string haystack, string needle, float offset) strstr =
205 len = strlen(needle);
206 endpos = strlen(haystack) - len;
207 while(offset <= endpos)
209 found = substring(haystack, offset, len);
218 float NUM_NEAREST_ENTITIES = 4;
219 entity nearest_entity[NUM_NEAREST_ENTITIES];
220 float nearest_length[NUM_NEAREST_ENTITIES];
221 entity(vector point, .string field, string value, vector axismod) findnearest =
232 localhead = find(world, field, value);
235 if((localhead.items == IT_KEY1 || localhead.items == IT_KEY2) && localhead.target == "###item###")
236 dist = localhead.oldorigin;
238 dist = localhead.origin;
240 dist = dist_x * axismod_x * '1 0 0' + dist_y * axismod_y * '0 1 0' + dist_z * axismod_z * '0 0 1';
243 for(i = 0; i < num_nearest; ++i)
245 if(len < nearest_length[i])
249 // now i tells us where to insert at
250 // INSERTION SORT! YOU'VE SEEN IT! RUN!
251 if(i < NUM_NEAREST_ENTITIES)
253 for(j = NUM_NEAREST_ENTITIES - 1; j >= i; --j)
255 nearest_length[j + 1] = nearest_length[j];
256 nearest_entity[j + 1] = nearest_entity[j];
258 nearest_length[i] = len;
259 nearest_entity[i] = localhead;
260 if(num_nearest < NUM_NEAREST_ENTITIES)
261 num_nearest = num_nearest + 1;
264 localhead = find(localhead, field, value);
267 // now use the first one from our list that we can see
268 for(i = 0; i < num_nearest; ++i)
270 traceline(point, nearest_entity[i].origin, TRUE, world);
271 if(trace_fraction == 1)
275 dprint("Nearest point (");
276 dprint(nearest_entity[0].netname);
277 dprint(") is not visible, using a visible one.\n");
279 return nearest_entity[i];
286 dprint("Not seeing any location point, using nearest as fallback.\n");
288 dprint("Candidates were: ");
289 for(j = 0; j < num_nearest; ++j)
293 dprint(nearest_entity[j].netname);
298 return nearest_entity[0];
301 void() target_location =
303 self.classname = "target_location";
304 // location name in netname
305 // eventually support: count, teamgame selectors, line of sight?
308 void() info_location =
310 self.classname = "target_location";
311 self.message = self.netname;
314 string NearestLocation(vector p)
319 loc = findnearest(p, classname, "target_location", '1 1 1');
326 loc = findnearest(p, target, "###item###", '1 1 4');
333 string(string msg) formatmessage =
340 msg_save = strzone(msg);
346 break; // too many replacements
348 p = strstr(msg_save, "%", p); // NOTE: this destroys msg as it's a tempstring!
351 replacement = substring(msg_save, p, 2);
352 escape = substring(msg_save, p + 1, 1);
355 else if(escape == "a")
356 replacement = ftos(floor(self.armorvalue));
357 else if(escape == "h")
358 replacement = ftos(floor(self.health));
359 else if(escape == "l")
360 replacement = NearestLocation(self.origin);
361 else if(escape == "y")
362 replacement = NearestLocation(self.cursor_trace_endpos);
363 else if(escape == "d")
364 replacement = NearestLocation(self.death_origin);
365 else if(escape == "w")
370 wep = self.switchweapon;
373 replacement = W_Name(wep);
375 else if(escape == "W")
377 if(self.items & IT_SHELLS) replacement = "shells";
378 else if(self.items & IT_NAILS) replacement = "bullets";
379 else if(self.items & IT_ROCKETS) replacement = "rockets";
380 else if(self.items & IT_CELLS) replacement = "cells";
381 else replacement = "batteries"; // ;)
383 else if(escape == "x")
385 replacement = self.cursor_trace_ent.netname;
386 if(!replacement || !self.cursor_trace_ent)
387 replacement = "nothing";
389 else if(escape == "p")
391 if(self.last_selected_player)
392 replacement = self.last_selected_player.netname;
394 replacement = "(nobody)";
396 msg = strcat(substring(msg_save, 0, p), replacement);
397 msg = strcat(msg, substring(msg_save, p+2, strlen(msg_save) - (p+2)));
399 msg_save = strzone(msg);
402 msg = strcat(msg_save, "");
413 >0: receives a cvar from name=argv(f) value=argv(f+1)
415 void GetCvars_handleString(float f, .string field, string name)
420 strunzone(self.field);
427 strunzone(self.field);
428 self.field = strzone(argv(f + 1));
432 stuffcmd(self, strcat("sendcvar ", name, "\n"));
434 void GetCvars_handleFloat(float f, .float field, string name)
442 self.field = stof(argv(f + 1));
445 stuffcmd(self, strcat("sendcvar ", name, "\n"));
447 void GetCvars(float f)
449 GetCvars_handleFloat(f, autoswitch, "cl_autoswitch");
450 GetCvars_handleFloat(f, cvar_cl_hidewaypoints, "cl_hidewaypoints");
451 GetCvars_handleFloat(f, cvar_cl_zoomfactor, "cl_zoomfactor");
452 GetCvars_handleFloat(f, cvar_cl_zoomspeed, "cl_zoomspeed");
453 GetCvars_handleFloat(f, cvar_cl_playerdetailreduction, "cl_playerdetailreduction");
454 GetCvars_handleFloat(f, cvar_cl_nogibs, "cl_nogibs");
455 GetCvars_handleFloat(f, cvar_scr_centertime, "scr_centertime");
456 GetCvars_handleFloat(f, cvar_cl_shownames, "cl_shownames");
457 GetCvars_handleString(f, cvar_g_nexuizversion, "g_nexuizversion");
458 GetCvars_handleFloat(f, cvar_cl_handicap, "cl_handicap");
461 float fexists(string f)
464 fh = fopen(f, FILE_READ);
471 void backtrace(string msg)
474 dev = cvar("developer");
475 cvar_set("developer", "1");
477 dprint("--- CUT HERE ---\nWARNING: ");
480 remove(world); // isn't there any better way to cause a backtrace?
481 dprint("\n--- CUT UNTIL HERE ---\n");
482 cvar_set("developer", ftos(dev));
485 void DistributeFragsAmongTeam(entity p, float targetteam, float factor)
496 // p.frags = 0; // do not harm the new team!
497 // return; // won't distribute negative scores
503 f = ceil(factor * p.frags);
504 p.frags = p.frags - f;
507 FOR_EACH_PLAYER(head)
509 if(head.team == targetteam)
515 DistributeEvenly_Init(f, nTeam);
517 FOR_EACH_PLAYER(head)
519 if(head.team == targetteam)
520 head.frags = head.frags + DistributeEvenly_Get(1);
523 string Team_ColorCode(float teamid)
525 if(teamid == COLOR_TEAM1)
527 else if(teamid == COLOR_TEAM2)
529 else if(teamid == COLOR_TEAM3)
531 else if(teamid == COLOR_TEAM4)
536 string Team_ColorName(float t)
538 // fixme: Search for team entities and get their .netname's!
549 string Team_ColorNameLowerCase(float t)
551 // fixme: Search for team entities and get their .netname's!
564 string decolorize(string s)
573 ch1 = substring(s, 0, 1);
574 ch2 = substring(s, 1, 1);
579 out = strcat(out, "^^");
603 out = strcat(out, "^^");
605 s = substring(s, n, strlen(s) - n);
609 s = substring(s, 1, strlen(s) - 1);
610 out = strcat(out, ch1);
615 #define strdecolorize(s) decolorize(s)
616 #define strlennocol(s) strlen(decolorize(s))
619 #define CENTERPRIO_POINT 1
620 #define CENTERPRIO_SPAM 2
621 #define CENTERPRIO_REBALANCE 2
622 #define CENTERPRIO_VOTE 4
623 #define CENTERPRIO_NORMAL 5
624 #define CENTERPRIO_MAPVOTE 9
625 #define CENTERPRIO_ADMIN 99
626 .float centerprint_priority;
627 .float centerprint_expires;
628 void centerprint_atprio(entity e, float prio, string s)
630 if(intermission_running)
631 if(prio < CENTERPRIO_MAPVOTE)
633 if(time > e.centerprint_expires)
634 e.centerprint_priority = 0;
635 if(prio >= e.centerprint_priority)
637 e.centerprint_priority = prio;
638 e.centerprint_expires = time + e.cvar_scr_centertime;
639 centerprint_builtin(e, s);
642 void centerprint_expire(entity e, float prio)
644 if(prio == e.centerprint_priority)
646 e.centerprint_priority = 0;
647 centerprint_builtin(e, "");
650 void centerprint(entity e, string s)
652 centerprint_atprio(e, CENTERPRIO_NORMAL, s);
657 // decolorizes and team colors the player name when needed
658 string playername(entity p)
661 if(teams_matter && !intermission_running && p.classname == "player")
663 t = Team_ColorCode(p.team);
664 return strcat(t, strdecolorize(p.netname));
670 vector(vector m1, vector m2) randompos =
674 v_x = m2_x * random() + m1_x;
675 v_y = m2_y * random() + m1_y;
676 v_z = m2_z * random() + m1_z;
680 // requires that m2>m1 in all coordinates, and that m4>m3
681 float(vector m1, vector m2, vector m3, vector m4) boxesoverlap = {return m2_x >= m3_x && m1_x <= m4_x && m2_y >= m3_y && m1_y <= m4_y && m2_z >= m3_z && m1_z <= m4_z;};
683 // requires the same, but is a stronger condition
684 float(vector smins, vector smaxs, vector bmins, vector bmaxs) boxinsidebox = {return smins_x >= bmins_x && smaxs_x <= bmaxs_x && smins_y >= bmins_y && smaxs_y <= bmaxs_y && smins_z >= bmins_z && smaxs_z <= bmaxs_z;};
686 float g_pickup_shells;
687 float g_pickup_shells_max;
688 float g_pickup_nails;
689 float g_pickup_nails_max;
690 float g_pickup_rockets;
691 float g_pickup_rockets_max;
692 float g_pickup_cells;
693 float g_pickup_cells_max;
694 float g_pickup_armorsmall;
695 float g_pickup_armorsmall_max;
696 float g_pickup_armormedium;
697 float g_pickup_armormedium_max;
698 float g_pickup_armorlarge;
699 float g_pickup_armorlarge_max;
700 float g_pickup_healthsmall;
701 float g_pickup_healthsmall_max;
702 float g_pickup_healthmedium;
703 float g_pickup_healthmedium_max;
704 float g_pickup_healthlarge;
705 float g_pickup_healthlarge_max;
706 float g_pickup_healthmega;
707 float g_pickup_healthmega_max;
710 float start_switchweapon;
711 float start_ammo_shells;
712 float start_ammo_nails;
713 float start_ammo_rockets;
714 float start_ammo_cells;
716 float start_armorvalue;
718 void readlevelcvars(void)
720 sv_cheats = cvar("sv_cheats");
721 g_cloaked = cvar("g_cloaked");
722 g_footsteps = cvar("g_footsteps");
723 g_grappling_hook = cvar("g_grappling_hook");
724 g_instagib = cvar("g_instagib");
725 g_laserguided_missile = cvar("g_laserguided_missile");
726 g_midair = cvar("g_midair");
727 g_minstagib = cvar("g_minstagib");
728 g_nixnex = cvar("g_nixnex");
729 g_nixnex_with_laser = cvar("g_nixnex_with_laser");
730 g_norecoil = cvar("g_norecoil");
731 g_rocketarena = cvar("g_rocketarena");
732 g_vampire = cvar("g_vampire");
734 g_pickup_shells = cvar("g_pickup_shells");
735 g_pickup_shells_max = cvar("g_pickup_shells_max");
736 g_pickup_nails = cvar("g_pickup_nails");
737 g_pickup_nails_max = cvar("g_pickup_nails_max");
738 g_pickup_rockets = cvar("g_pickup_rockets");
739 g_pickup_rockets_max = cvar("g_pickup_rockets_max");
740 g_pickup_cells = cvar("g_pickup_cells");
741 g_pickup_cells_max = cvar("g_pickup_cells_max");
742 g_pickup_armorsmall = cvar("g_pickup_armorsmall");
743 g_pickup_armorsmall_max = cvar("g_pickup_armorsmall_max");
744 g_pickup_armormedium = cvar("g_pickup_armormedium");
745 g_pickup_armormedium_max = cvar("g_pickup_armormedium_max");
746 g_pickup_armorlarge = cvar("g_pickup_armorlarge");
747 g_pickup_armorlarge_max = cvar("g_pickup_armorlarge_max");
748 g_pickup_healthsmall = cvar("g_pickup_healthsmall");
749 g_pickup_healthsmall_max = cvar("g_pickup_healthsmall_max");
750 g_pickup_healthmedium = cvar("g_pickup_healthmedium");
751 g_pickup_healthmedium_max = cvar("g_pickup_healthmedium_max");
752 g_pickup_healthlarge = cvar("g_pickup_healthlarge");
753 g_pickup_healthlarge_max = cvar("g_pickup_healthlarge_max");
754 g_pickup_healthmega = cvar("g_pickup_healthmega");
755 g_pickup_healthmega_max = cvar("g_pickup_healthmega_max");
757 // initialize starting values for players
759 start_switchweapon = 0;
760 start_ammo_shells = 0;
761 start_ammo_nails = 0;
762 start_ammo_rockets = 0;
763 start_ammo_cells = 0;
764 start_health = cvar("g_balance_health_start");
765 start_armorvalue = cvar("g_balance_armor_start");
769 start_items = IT_NEX;
770 start_switchweapon = WEP_NEX;
771 weapon_action(start_switchweapon, WR_PRECACHE);
772 start_ammo_cells = 999;
774 else if(g_rocketarena)
776 start_items = IT_ROCKET_LAUNCHER;
777 start_switchweapon = WEP_ROCKET_LAUNCHER;
778 weapon_action(start_switchweapon, WR_PRECACHE);
779 start_ammo_rockets = 999;
784 // will be done later
789 start_armorvalue = 0;
790 start_items = IT_NEX;
791 start_switchweapon = WEP_NEX;
792 weapon_action(start_switchweapon, WR_PRECACHE);
793 start_ammo_cells = cvar("g_minstagib_ammo_start");
794 g_minstagib_invis_alpha = cvar("g_minstagib_invis_alpha");
800 start_ammo_shells = cvar("g_lms_start_ammo_shells");
801 start_ammo_nails = cvar("g_lms_start_ammo_nails");
802 start_ammo_rockets = cvar("g_lms_start_ammo_rockets");
803 start_ammo_cells = cvar("g_lms_start_ammo_cells");
804 start_health = cvar("g_lms_start_health");
805 start_armorvalue = cvar("g_lms_start_armor");
807 else if (cvar("g_use_ammunition")) {
808 start_ammo_shells = cvar("g_start_ammo_shells");
809 start_ammo_nails = cvar("g_start_ammo_nails");
810 start_ammo_rockets = cvar("g_start_ammo_rockets");
811 start_ammo_cells = cvar("g_start_ammo_cells");
813 start_ammo_shells = cvar("g_pickup_shells_max");
814 start_ammo_nails = cvar("g_pickup_nails_max");
815 start_ammo_rockets = cvar("g_pickup_rockets_max");
816 start_ammo_cells = cvar("g_pickup_cells_max");
819 if (cvar("g_start_weapon_laser") || g_lms)
821 start_items = start_items | IT_LASER;
822 start_switchweapon = WEP_LASER;
823 weapon_action(start_switchweapon, WR_PRECACHE);
825 if (cvar("g_start_weapon_shotgun") || g_lms)
827 start_items = start_items | IT_SHOTGUN;
828 start_switchweapon = WEP_SHOTGUN;
829 weapon_action(start_switchweapon, WR_PRECACHE);
831 if (cvar("g_start_weapon_uzi") || g_lms)
833 start_items = start_items | IT_UZI;
834 start_switchweapon = WEP_UZI;
835 weapon_action(start_switchweapon, WR_PRECACHE);
837 if (cvar("g_start_weapon_grenadelauncher") || g_lms)
839 start_items = start_items | IT_GRENADE_LAUNCHER;
840 start_switchweapon = WEP_GRENADE_LAUNCHER;
841 weapon_action(start_switchweapon, WR_PRECACHE);
843 if (cvar("g_start_weapon_electro") || g_lms)
845 start_items = start_items | IT_ELECTRO;
846 start_switchweapon = WEP_ELECTRO;
847 weapon_action(start_switchweapon, WR_PRECACHE);
849 if (cvar("g_start_weapon_crylink") || g_lms)
851 start_items = start_items | IT_CRYLINK;
852 start_switchweapon = WEP_CRYLINK;
853 weapon_action(start_switchweapon, WR_PRECACHE);
855 if (cvar("g_start_weapon_nex") || g_lms)
857 start_items = start_items | IT_NEX;
858 start_switchweapon = WEP_NEX;
859 weapon_action(start_switchweapon, WR_PRECACHE);
861 if (cvar("g_start_weapon_hagar") || g_lms)
863 start_items = start_items | IT_HAGAR;
864 start_switchweapon = WEP_HAGAR;
865 weapon_action(start_switchweapon, WR_PRECACHE);
867 if (cvar("g_start_weapon_rocketlauncher") || g_lms)
869 start_items = start_items | IT_ROCKET_LAUNCHER;
870 start_switchweapon = WEP_ROCKET_LAUNCHER;
871 weapon_action(start_switchweapon, WR_PRECACHE);
877 // TODO sound pack system
880 string precache_sound_builtin (string s) = #19;
881 void(entity e, float chan, string samp, float vol, float atten) sound_builtin = #8;
882 string precache_sound(string s)
884 return precache_sound_builtin(strcat(soundpack, s));
886 void play2(entity e, string filename)
888 stuffcmd(e, strcat("play2 ", soundpack, filename, "\n"));
890 void sound(entity e, float chan, string samp, float vol, float atten)
892 sound_builtin(e, chan, strcat(soundpack, samp), vol, atten);
896 string precache_sound (string s) = #19;
897 void(entity e, float chan, string samp, float vol, float atten) sound = #8;
898 void play2(entity e, string filename)
900 stuffcmd(e, strcat("play2 ", filename, "\n"));
903 void play2team(float t, string filename)
906 FOR_EACH_REALPLAYER(head)
909 play2(head, filename);
913 void PrecachePlayerSounds(string f);
914 void precache_all_models(string pattern)
916 float globhandle, i, n;
919 globhandle = search_begin(pattern, TRUE, FALSE);
922 n = search_getsize(globhandle);
923 for(i = 0; i < n; ++i)
925 //print(search_getfilename(globhandle, i), "\n");
926 f = search_getfilename(globhandle, i);
928 PrecachePlayerSounds(strcat(f, ".sounds"));
930 search_end(globhandle);
935 // gamemode related things
936 precache_model ("models/misc/chatbubble.spr");
937 precache_model ("models/misc/teambubble.spr");
940 precache_model ("models/runematch/curse.mdl");
941 precache_model ("models/runematch/rune.mdl");
944 // Precache all player models if desired
945 if (cvar("sv_precacheplayermodels"))
947 PrecachePlayerSounds("sound/player/default.sounds");
948 precache_all_models("models/player/*.zym");
949 precache_all_models("models/player/*.dpm");
950 precache_all_models("models/player/*.md3");
951 precache_all_models("models/player/*.psk");
952 //precache_model("models/player/carni.zym");
953 //precache_model("models/player/crash.zym");
954 //precache_model("models/player/grunt.zym");
955 //precache_model("models/player/headhunter.zym");
956 //precache_model("models/player/insurrectionist.zym");
957 //precache_model("models/player/jeandarc.zym");
958 //precache_model("models/player/lurk.zym");
959 //precache_model("models/player/lycanthrope.zym");
960 //precache_model("models/player/marine.zym");
961 //precache_model("models/player/nexus.zym");
962 //precache_model("models/player/pyria.zym");
963 //precache_model("models/player/shock.zym");
964 //precache_model("models/player/skadi.zym");
965 //precache_model("models/player/specop.zym");
966 //precache_model("models/player/visitant.zym");
971 precache_sound ("misc/footstep01.wav");
972 precache_sound ("misc/footstep02.wav");
973 precache_sound ("misc/footstep03.wav");
974 precache_sound ("misc/footstep04.wav");
975 precache_sound ("misc/footstep05.wav");
976 precache_sound ("misc/footstep06.wav");
979 // gore and miscellaneous sounds
980 //precache_sound ("misc/h2ohit.wav");
981 precache_model ("models/gibs/bloodyskull.md3");
982 precache_model ("models/gibs/chunk.mdl");
983 precache_model ("models/gibs/eye.md3");
984 precache_model ("models/gibs/gib1.md3");
985 precache_model ("models/gibs/gib1.mdl");
986 precache_model ("models/gibs/gib2.mdl");
987 precache_model ("models/gibs/gib3.mdl");
988 precache_model ("models/gibs/gib5.md3");
989 precache_model ("models/hook.md3");
990 precache_sound ("misc/armorimpact.wav");
991 precache_sound ("misc/bodyimpact1.wav");
992 precache_sound ("misc/bodyimpact2.wav");
993 precache_sound ("misc/gib.wav");
994 precache_sound ("misc/gib_splat01.wav");
995 precache_sound ("misc/gib_splat02.wav");
996 precache_sound ("misc/gib_splat03.wav");
997 precache_sound ("misc/gib_splat04.wav");
998 precache_sound ("misc/hit.wav");
999 precache_sound ("misc/hitground1.wav");
1000 precache_sound ("misc/hitground2.wav");
1001 precache_sound ("misc/hitground3.wav");
1002 precache_sound ("misc/hitground4.wav");
1003 precache_sound ("misc/null.wav");
1004 precache_sound ("misc/spawn.wav");
1005 precache_sound ("misc/talk.wav");
1006 precache_sound ("misc/teleport.wav");
1007 precache_sound ("player/lava.wav");
1008 precache_sound ("player/slime.wav");
1010 // announcer sounds - male
1011 //precache_sound ("announcer/male/electrobitch.wav");
1012 precache_sound ("announcer/male/03kills.wav");
1013 precache_sound ("announcer/male/05kills.wav");
1014 precache_sound ("announcer/male/10kills.wav");
1015 precache_sound ("announcer/male/15kills.wav");
1016 precache_sound ("announcer/male/20kills.wav");
1017 precache_sound ("announcer/male/25kills.wav");
1018 precache_sound ("announcer/male/30kills.wav");
1019 precache_sound ("announcer/male/botlike.wav");
1020 precache_sound ("announcer/male/yoda.wav");
1022 // announcer sounds - robotic
1023 precache_sound ("announcer/robotic/1fragleft.wav");
1024 precache_sound ("announcer/robotic/1minuteremains.wav");
1025 precache_sound ("announcer/robotic/2fragsleft.wav");
1026 precache_sound ("announcer/robotic/3fragsleft.wav");
1029 precache_sound ("announcer/robotic/lastsecond.wav");
1030 precache_sound ("announcer/robotic/narrowly.wav");
1031 precache_sound ("announcer/robotic/1.wav");
1032 precache_sound ("announcer/robotic/2.wav");
1033 precache_sound ("announcer/robotic/3.wav");
1034 precache_sound ("announcer/robotic/4.wav");
1035 precache_sound ("announcer/robotic/5.wav");
1036 precache_sound ("announcer/robotic/6.wav");
1037 precache_sound ("announcer/robotic/7.wav");
1038 precache_sound ("announcer/robotic/8.wav");
1039 precache_sound ("announcer/robotic/9.wav");
1040 precache_sound ("announcer/robotic/10.wav");
1043 // common weapon precaches
1044 precache_sound ("weapons/weapon_switch.wav");
1045 precache_sound ("weapons/weaponpickup.wav");
1046 if (cvar("g_grappling_hook"))
1048 precache_sound ("weapons/hook_fire.wav"); // hook
1049 precache_sound ("weapons/hook_impact.wav"); // hook
1052 if (cvar("sv_precacheweapons") || g_nixnex)
1054 //precache weapon models/sounds
1057 while (wep <= WEP_LAST)
1059 weapon_action(wep, WR_PRECACHE);
1064 // plays music for the level if there is any
1067 precache_sound (self.noise);
1068 ambientsound ('0 0 0', self.noise, 1.00, ATTN_NONE);