void _MapWithMostVotes (void) { char buf[1024], sbuf[512]; if (_MostVotesStr(sbuf)) { Com_sprintf(buf, sizeof(buf), "Most wanted map: %s", sbuf); G_HighlightStr(buf, buf, sizeof(buf)); gi.bprintf(PRINT_HIGH, "%s\n", buf); } }
void _CheckScrambleVote (void) { int numvotes = 0, playernum = 0; float votes = 0.0f; char buf[128]; _CalcScrambleVotes(&playernum, &numvotes, &votes); if (numvotes > 0) { Com_sprintf(buf, sizeof(buf), "Scramble: %d votes (%.1f%%), need %.1f%%", numvotes, votes, scramblevote_pass->value); G_HighlightStr(buf, buf, sizeof(buf)); gi.bprintf(PRINT_HIGH, "%s\n", buf); } if (playernum < scramblevote_min->value) return; if (numvotes < scramblevote_need->value) return; if (votes < scramblevote_pass->value) return; ScrambleTeams(); }
/*QUAKED worldspawn (0 0 0) ? Only used for the world. "sky" environment map name "skyaxis" vector axis for rotating sky "skyrotate" speed of rotation in degrees/second "sounds" music cd track number "gravity" 800 is default gravity "message" text to print at user logon */ void SP_worldspawn(edict_t *ent) { char buffer[MAX_QPATH]; ent->movetype = MOVETYPE_PUSH; ent->solid = SOLID_BSP; ent->inuse = qtrue; // since the world doesn't use G_Spawn() ent->s.modelindex = 1; // world model is always index 1 //--------------- // reserve some spots for dead player bodies for coop / deathmatch InitBodyQue(); // set configstrings for items SetItemNames(); //if (st.nextmap) // strcpy(level.nextmap, st.nextmap); // make some data visible to the server if (ent->message && ent->message[0]) { gi.configstring(CS_NAME, ent->message); } ent->message = NULL; if (st.sky && st.sky[0]) gi.configstring(CS_SKY, st.sky); else gi.configstring(CS_SKY, "unit1_"); gi.configstring(CS_SKYROTATE, va("%f", st.skyrotate)); gi.configstring(CS_SKYAXIS, va("%f %f %f", st.skyaxis[0], st.skyaxis[1], st.skyaxis[2])); gi.configstring(CS_CDTRACK, va("%i", ent->sounds)); gi.configstring(CS_MAXCLIENTS, va("%i", (int)(maxclients->value))); // status bar program gi.configstring(CS_STATUSBAR, dm_statusbar); gi.configstring(CS_OBSERVE, "SPECT"); G_HighlightStr(buffer, "SPECTATOR MODE", sizeof(buffer)); gi.configstring(CS_SPECMODE, buffer); G_HighlightStr(buffer, "Press ATTACK to join", sizeof(buffer)); gi.configstring(CS_PREGAME, buffer); //--------------- // help icon for statusbar gi.imageindex("i_help"); level.images.health = gi.imageindex("i_health"); gi.imageindex("help"); gi.imageindex("field_3"); level.images.powershield = gi.imageindex("i_powershield"); level.images.quad = gi.imageindex("p_quad"); level.images.invulnerability = gi.imageindex("p_invulnerability"); level.images.envirosuit = gi.imageindex("p_envirosuit"); level.images.rebreather = gi.imageindex("p_rebreather"); if (!st.gravity) gi.cvar_set("sv_gravity", "800"); else gi.cvar_set("sv_gravity", st.gravity); level.sounds.fry = gi.soundindex("player/fry.wav"); // standing in lava / slime level.sounds.lava_in = gi.soundindex("player/lava_in.wav"); level.sounds.burn[0] = gi.soundindex("player/burn1.wav"); level.sounds.burn[1] = gi.soundindex("player/burn2.wav"); level.sounds.drown = gi.soundindex("player/drown1.wav"); PrecacheItem(INDEX_ITEM(ITEM_BLASTER)); gi.soundindex("player/lava1.wav"); gi.soundindex("player/lava2.wav"); gi.soundindex("misc/pc_up.wav"); gi.soundindex("misc/talk1.wav"); level.sounds.secret = gi.soundindex("misc/secret.wav"); level.sounds.count = gi.soundindex("world/10_0.wav"); level.sounds.udeath = gi.soundindex("misc/udeath.wav"); gi.soundindex("items/respawn1.wav"); // sexed sounds level.sounds.death[0] = gi.soundindex("*death1.wav"); level.sounds.death[1] = gi.soundindex("*death2.wav"); level.sounds.death[2] = gi.soundindex("*death3.wav"); level.sounds.death[3] = gi.soundindex("*death4.wav"); level.sounds.fall[0] = gi.soundindex("*fall1.wav"); level.sounds.fall[1] = gi.soundindex("*fall2.wav"); level.sounds.gurp[0] = gi.soundindex("*gurp1.wav"); // drowning damage level.sounds.gurp[1] = gi.soundindex("*gurp2.wav"); level.sounds.jump = gi.soundindex("*jump1.wav"); // player jump level.sounds.pain[0][0] = gi.soundindex("*pain25_1.wav"); level.sounds.pain[0][1] = gi.soundindex("*pain25_2.wav"); level.sounds.pain[1][0] = gi.soundindex("*pain50_1.wav"); level.sounds.pain[1][1] = gi.soundindex("*pain50_2.wav"); level.sounds.pain[2][0] = gi.soundindex("*pain75_1.wav"); level.sounds.pain[2][1] = gi.soundindex("*pain75_2.wav"); level.sounds.pain[3][0] = gi.soundindex("*pain100_1.wav"); level.sounds.pain[3][1] = gi.soundindex("*pain100_2.wav"); level.sounds.rg_hum = gi.soundindex("weapons/rg_hum.wav"); level.sounds.bfg_hum = gi.soundindex("weapons/bfg_hum.wav"); // sexed models // THIS ORDER MUST MATCH THE DEFINES IN g_local.h // you can add more, max 15 gi.modelindex("#w_blaster.md2"); gi.modelindex("#w_shotgun.md2"); gi.modelindex("#w_sshotgun.md2"); gi.modelindex("#w_machinegun.md2"); gi.modelindex("#w_chaingun.md2"); gi.modelindex("#a_grenades.md2"); gi.modelindex("#w_glauncher.md2"); gi.modelindex("#w_rlauncher.md2"); gi.modelindex("#w_hyperblaster.md2"); gi.modelindex("#w_railgun.md2"); gi.modelindex("#w_bfg.md2"); //------------------- level.sounds.gasp[0] = gi.soundindex("player/gasp1.wav"); // gasping for air level.sounds.gasp[1] = gi.soundindex("player/gasp2.wav"); // head breaking surface, not gasping level.sounds.watr_in = gi.soundindex("player/watr_in.wav"); // feet hitting water level.sounds.watr_out = gi.soundindex("player/watr_out.wav"); // feet leaving water level.sounds.watr_un = gi.soundindex("player/watr_un.wav"); // head going underwater level.sounds.breath[0] = gi.soundindex("player/u_breath1.wav"); level.sounds.breath[1] = gi.soundindex("player/u_breath2.wav"); gi.soundindex("items/pkup.wav"); // bonus item pickup gi.soundindex("world/land.wav"); // landing thud gi.soundindex("misc/h2ohit1.wav"); // landing splash gi.soundindex("items/damage.wav"); gi.soundindex("items/protect.wav"); gi.soundindex("items/protect4.wav"); level.sounds.noammo = gi.soundindex("weapons/noammo.wav"); gi.soundindex("infantry/inflies1.wav"); level.sounds.xian = gi.soundindex("world/xian1.wav"); level.sounds.makron = gi.soundindex("makron/laf4.wav"); // gibs level.models.meat = gi.modelindex("models/objects/gibs/sm_meat/tris.md2"); /*level.models.arm = gi.modelindex("models/objects/gibs/arm/tris.md2"); level.models.bones[0] = gi.modelindex("models/objects/gibs/bone/tris.md2"); level.models.bones[1] = gi.modelindex("models/objects/gibs/bone2/tris.md2"); level.models.chest = gi.modelindex("models/objects/gibs/chest/tris.md2"); level.models.skull = gi.modelindex("models/objects/gibs/skull/tris.md2");*/ level.models.head = gi.modelindex("models/objects/gibs/head2/tris.md2"); // // Setup light animation tables. 'a' is total darkness, 'z' is doublebright. // // 0 normal gi.configstring(CS_LIGHTS + 0, "m"); // 1 FLICKER (first variety) gi.configstring(CS_LIGHTS + 1, "mmnmmommommnonmmonqnmmo"); // 2 SLOW STRONG PULSE gi.configstring(CS_LIGHTS + 2, "abcdefghijklmnopqrstuvwxyzyxwvutsrqponmlkjihgfedcba"); // 3 CANDLE (first variety) gi.configstring(CS_LIGHTS + 3, "mmmmmaaaaammmmmaaaaaabcdefgabcdefg"); // 4 FAST STROBE gi.configstring(CS_LIGHTS + 4, "mamamamamama"); // 5 GENTLE PULSE 1 gi.configstring(CS_LIGHTS + 5, "jklmnopqrstuvwxyzyxwvutsrqponmlkj"); // 6 FLICKER (second variety) gi.configstring(CS_LIGHTS + 6, "nmonqnmomnmomomno"); // 7 CANDLE (second variety) gi.configstring(CS_LIGHTS + 7, "mmmaaaabcdefgmmmmaaaammmaamm"); // 8 CANDLE (third variety) gi.configstring(CS_LIGHTS + 8, "mmmaaammmaaammmabcdefaaaammmmabcdefmmmaaaa"); // 9 SLOW STROBE (fourth variety) gi.configstring(CS_LIGHTS + 9, "aaaaaaaazzzzzzzz"); // 10 FLUORESCENT FLICKER gi.configstring(CS_LIGHTS + 10, "mmamammmmammamamaaamammma"); // 11 SLOW PULSE NOT FADE TO BLACK gi.configstring(CS_LIGHTS + 11, "abcdefghijklmnopqrrqponmlkjihgfedcba"); // styles 32-62 are assigned by the light program for switchable lights // 63 testing gi.configstring(CS_LIGHTS + 63, "a"); }