//***********************************************************// // Gun Game // // v3.4.81 // // // // Thanks to the following people for helping contribute to // // making the Gun Game better for everyone: // // Mattie, XE_Manup , HitThePipe, all the ES beta team, // // Awuh0, and everyone that has helped beta test the GG. // // // // http://mattie.info/cs/ // // http://www.cagemonkey.org // //***********************************************************// block config { // ############################################## // This is the only block you should ever edit // UNLESS YOU KNOW WHAT YOU ARE DOING!! // ############################################### //************************************************************ // ADMINS //******** // Add all admins for the Deathmatch admin commands here. // Separate each STEAM_ID with a comma, NO SPACES!! es_xsetinfo gg_admins "STEAM_ID_LAN,STEAM_0:0:796294" //************************************************************ // WEAPON ORDER //************** // Your choices are: // // Pistols: // glock // usp // p228 // deagle // fiveseven // elite // // Shotguns: // m3 // xm1014 // // Sub Machine Guns: // tmp // mac10 // mp5navy // ump45 // p90 // // Rifles: // galil // famas // ak47 // scout // m4a1 // sg550 // g3sg1 // awp // sg552 // aug // // Machine Gun: // m249 // // Other: // hegrenade // knife // // Pick which ones you want and put them in order with level 1 being first in the list then level 2, level 3, etc. // You can repeat weapons if you like. // Separate each weapon with a comma ',' NO SPACES!! // Default weapon order: // "glock,usp,p228,deagle,fiveseven,elite,m3,xm1014,tmp,mac10,mp5navy,ump45,p90,galil,famas,ak47,scout,m4a1,sg552,aug,m249,hegrenade,knife" es_xsetinfo gg_weapon_order "m249,aug,sg552,m4a1,scout,ak47,famas,gali,p90,ump45,mp5navy,mac10,ymp,xm1014,m3,elite,fiveseven,deagle,p228,usp,glock,hegranade,knife" //************************************************************ // JOIN MESSAGE //************** // Gun Game join message, popup giving players instructions on how to play // 1=on, 0=off es_xsetinfo gg_join_msg 1 //************************************************************ // WORLDSPAWN SUICIDES //********************* // Worldspawn deaths (falling) count as suicides 0=no, 1=yes es_xsetinfo worldspawn_suicide 1 //************************************************************ // AFK MANAGER //************* // This controls what happens to players when they are afk, 0=off // Set this to the number of deaths a player is afk before the manager takes action es_xsetinfo gg_afk_deaths 5 // // This controls what action is taken to afk players after they die afk for the above rounds // 1=kick from server, 2=moved to spectator es_xsetinfo gg_afk_action 2 //************************************************************ // BOMBING //********* // Give level for planting/defusing 0=no, 1=yes es_xsetinfo bomb_defuse_lvl 1 //************************************************************ // HANDICAP //********** // Turn GG handicap 0=off, 1=on // Gives joining players the avg level of all other players when they join late. // If you're in the top10, you do not get this handicap even if it is turned on. es_xsetinfo gg_handicap_on 1 // // GG Top10 handicap 0=off, 1=on // Allow players in the top10 to receive a handicap with the rest of the players. // Handicap must also be turned on above for this to work. es_xsetinfo gg_top10_handicap 1 //************************************************************ // MAX LEVELS //************ // Set max levels allowed per round, 0=off // Default is 3, so players cannot get more than 3 levels in one round. es_xsetinfo gg_max_lvl 3 //************************************************************ // EXTRAS //******** // Turn Knife Pro level stealing on/off es_xsetinfo gg_knife_pro 0 // // Turn Triple Level Bonus 0=off, 1=on // Turbo Mode automatically overrides the Triple Level Bonus to OFF es_xsetinfo gg_triple_on 0 // // Turn Turbo Mode 0=off, 1=on // This gives you your next weapon immediately when you levelup // THIS OVERRIDES MAX LEVEL PER ROUND, AND TRIPLE LEVEL BONUS!! es_xsetinfo gg_turbo 1 // // Knife Elite mode 0=off, 1=on // After a player levels up, they only get a knife until the next round. // THIS WILL OVERRIDE TURBO MODE!! es_xsetinfo gg_knife_elite 0 // // Multiple Kills mode 0=off, X=number of kills required // Set to number of kills required to level up. // This counts kills across rounds so you don't have to get them all in one round. es_xsetinfo gg_multikill 0 //************************************************************ // DEATHMATCH //************ // Deathmatch mode, 0=off, 1=on // This loads as a plugin addon to the Gun Game // Recommended settings for deathmatch: // KnifePro on, Turbo on, KnifeElite off, Multikill set to 2 or 3, gg_nade_glock set to 1 es_xsetinfo gg_dm_script 1 // // Spawn protection time for Deathmatch // Set this to the amount of seconds you want spawn protection // 0=off, recommended not to exceed 4 seconds es_xsetinfo gg_dm_spawn_protect 2 // // Spawn protection check for Deathmatch // Remove spawn protection if the player uses a weapon before the spawn protection has expired // *Note* THIS CAN CAUSE SERVER LAG IF IT IS ENABLED! es_xsetinfo gg_dm_remove_protect 1 // // DISABLE MAP OBJECTIVES // Setting this to 1 will disable the objectives (bombing, rescuing hostages) // Note: This does not require the Deathmatch addon to be loaded. es_xsetinfo gg_obj_remove 0 //************************************************************ // WARMUP TIMER //************** // Warmup timer 0=off, x=number of seconds to warmup before restart // This is recommended to allow all clients to connect before the game starts. es_xsetinfo gg_warmup_timer_setting 30 // // Forces warmup rounds to be knife only 0=off, 1=on es_xsetinfo gg_knife_warmup 1 //************************************************************ // NADE LEVEL BONUS //****************** // Additional weapons for players on nade level // 1=on, 0=off // This gives a glock with 50 bullets es_xsetinfo gg_nade_glock 0 // This gives a smokegrenade es_xsetinfo gg_nade_smoke 1 // This gives a flashbang es_xsetinfo gg_nade_flash 1 // This gives an extra nade to players if they get a kill with another weapon es_xsetinfo gg_extra_nades 0 //************************************************************ // MAP VOTING & MAPCYCLE //*********************** // Used to start random votemap when someone reaches the next to last level 0=off, 1=Mani, 2=Eventscripts** // **Note: The Eventscripts version can be used as a custom mapcycle also. // // If you want to use your Mani plugin for end of map votes, set this to 1 // If you want to use Eventscripts for end of map votes or mapcycle, set this to 2 and set the configs below. // Also, for Eventscripts, be sure to setup your es_gg_votemaps_db.txt file with at least 5 maps. es_xsetinfo gg_vote_setting 2 // // Eventscripts map voting config section es_xsetinfo gg_allow_voting 1 //You can turn voting on/off so you can use this as a custom mapcycle file. 0=off, 1=on es_xsetinfo gg_vote_show_time 30 //In seconds ->Amount of time for vote //************************************************************ // MAP PRESETS //************* // Gun Game map presets // It is recommended that you leave these settings alone, especially winlimit and chattime. alias gg_map_setup "mp_timelimit 45; mp_winlimit 0; sv_alltalk 0; mp_chattime 15; mp_c4timer 25; mp_friendlyfire 0" // // Automatically turn friendly fire ON when a player reaches grenade level. es_xsetinfo gg_ff_auto 1 //************************************************************ // SOUNDS //******** // Sound files // Put the exact file name here preceded with "gungame/" Make sure there are no spaces in it. // Rename the file if you have to remove any spaces in the name. // Put your sounds in the cstrike/sound/gungame directory // To disable a particular sound, leave it empty between the quotes, "" es_xsetinfo gg_sound_levelup "gungame/smb3_powerup.wav" es_xsetinfo gg_sound_leveldown "gungame/smb3_powerdown.wav" es_xsetinfo gg_sound_levelsteal "gungame/smb3_1-up.wav" es_xsetinfo gg_sound_nade "gungame/nade_level.wav" es_xsetinfo gg_sound_knife "gungame/knife_level.wav" es_xsetinfo gg_sound_welcome "gungame/gungame2.wav" // Default warning sound is "ambient/misc/brass_bell_C.wav" es_xsetinfo gg_sound_warning "gungame/smb_warning2.mp3" // Default winner sound is "music/HL2_song15.mp3" es_xsetinfo gg_sound_winner "music/HL2_song15.mp3" // // The triple level sound must be exactly 10 seconds long to work correctly with the Gun Game code es_xsetinfo gg_sound_triple "gungame/smb_star.mp3" // // Default kill tone for multikill mode is "common/stuck1.wav" es_xsetinfo gg_sound_kill "common/stuck1.wav" // // RANDOM WINNER SONG // 0=off, 1=on es_xsetinfo gg_rand_song 0 // This will override your gg_sound_winner setting above and play a random song from this list. // EACH FILE MUST BE LOCATED IN YOUR /cstrike/sound/gungame/ DIRECTORY!! // Put each song filename in this list seperated by commas, NO SPACES!!! es_xsetinfo gg_songlist "bombtrack.mp3,wakeup.mp3,stand_alone.mp3,matrixwin1.mp3,clickboom.mp3,dontstay.mp3,numb.mp3" // // ##### END OF CONFIG BLOCK ##### // } //######################################### // DO NOT EDIT ANYTHING BELOW THIS LINE!!! //######################################### block load { // Load popup if it's not already loaded es_xload popup // Load config es_xdoblock gungame3/config // Turn eventscripts_noisy on es_xdoblock corelib/noisy_on // Deathmatch addon if (server_var(gg_dm_script) == 1) then es_xload gungame3/gg_css_dm // Eventscripts map voting and mapcycle if (server_var(gg_vote_setting) == 2) then es_xload gungame3/gg_voting // Random winner sounds if (server_var(gg_rand_song) == 1) then es_xload gungame3/gg_songs // Variable to test if things exist es_xsetinfo gg_exists 0 // Gun Game map presets es_xdelayed 2 gg_map_setup // Setup Gun Game dir for databases es_xsetinfo gg_dir "|gungame3" // Create console commands es_xsetinfo gg_exists 0 es_xexists gg_exists command gg_setlevel if (server_var(gg_exists) == 0) do { es_xregcmd gg_setlevel gungame3/gg_set_level "Allows admin to change player level: gg_setlevel " } es_xsetinfo gg_exists 0 es_xexists gg_exists command gg_reset if (server_var(gg_exists) == 0) do { es_xregcmd gg_reset gungame3/gg_reset_scores "Resets all player records for the Gun Game and restarts the current map" } es_xsetinfo gg_exists 0 es_xexists gg_exists command gg_setweapons if (server_var(gg_exists) == 0) do { es_xregcmd gg_setweapons gungame3/gg_set_weapon_order "Allows changes to the weapon order: gg_setweapons ,," } es_xsetinfo gg_exists 0 es_xexists gg_exists command gg_triple_cmd if (server_var(gg_exists) == 0) do { es_xregcmd gg_triple_cmd gungame3/gg_triple_finish "Internal Gun Game command" } es_xsetinfo gg_exists 0 es_xexists gg_exists command gg_start_round if (server_var(gg_exists) == 0) do { es_xregcmd gg_start_round gungame3/main_reset_player "Internal Gun Game command" } es_xsetinfo gg_exists 0 es_xexists gg_exists command gg_turbo_equip if (server_var(gg_exists) == 0) do { es_xregcmd gg_turbo_equip gungame3/give_turbo_weapon "Internal Gun Game command" } // Create weapon list es_xsetinfo gg_tmp_weapon 0 es_xsetinfo gg_levels 0 es_token gg_levels server_var(gg_weapon_order) 0 , es_xexists gg_exists keygroup gg_weapons if (server_var(gg_exists) == 1) then es_xkeygroupdelete gg_weapons es_xkeygroupcreate gg_weapons es_xsetinfo gg_level_counter 1 if (server_var(gg_levels) > 0) then es_xdoblock gungame3/create_weapon_list // Dynamic level total - 1 es_setinfo gg_level_dynamic server_var(gg_levels) es_xmath gg_level_dynamic - 1 // Public cvar announcing server runs Gun Game es_xsetinfo eventscripts_gg "3.4.81" es_xmakepublic eventscripts_gg // gg_winners open flag es_xsetinfo win_db_open 0 es_xsetinfo gg_read_write 0 // Level variables // used to calc current leader es_xsetinfo ldr_level 1 // This variable allows only one winner if 2 people on knife level get their kill es_xsetinfo gg_one_winner 0 // afk database keygroupremove afk_db es_xkeygroupcreate afk_db // level db for reconnecting players keygroupremove lvl_db es_xkeygroupcreate lvl_db // player pref database keygroupremove gg_pref es_xkeygroupcreate gg_pref es_keygroupload gg_pref server_var(gg_dir) // gg_players database keygroupremove gg_players es_xkeygroupcreate gg_players // gg_top10 database keygroupremove gg_top10 es_xkeygroupcreate gg_top10 es_keygroupload gg_top10 server_var(gg_dir) es_xsetinfo top10_check 0 es_xsetinfo top10_counter 1 es_xkeygetvalue top10_check gg_top10 10 steam if (server_var(top10_check) == 0) then es_xdoblock gungame3/create_top10 // Add players already playing to the databases es_xcreateplayerlist gg_player_list es_xforeachkey key_x in gg_player_list "es_xdoblock gungame3/player_setup_in_progress" es_xkeygroupdelete gg_player_list // generate ammo clip info keygroupremove gg_ammo_props keygroupremove gg_ammo_count es_xkeycreate gg_ammo_props es_xkeycreate gg_ammo_count es_xkeysetvalue gg_ammo_props "weapon_glock" "CCSPlayer.baseclass.localdata.m_iAmmo.006" es_xkeysetvalue gg_ammo_count "weapon_glock" 200 es_xkeysetvalue gg_ammo_props "weapon_usp" "CCSPlayer.baseclass.localdata.m_iAmmo.008" es_xkeysetvalue gg_ammo_count "weapon_usp" 200 es_xkeysetvalue gg_ammo_props "weapon_p228" "CCSPlayer.baseclass.localdata.m_iAmmo.009" es_xkeysetvalue gg_ammo_count "weapon_p228" 200 es_xkeysetvalue gg_ammo_props "weapon_deagle" "CCSPlayer.baseclass.localdata.m_iAmmo.001" es_xkeysetvalue gg_ammo_count "weapon_deagle" 200 es_xkeysetvalue gg_ammo_props "weapon_fiveseven" "CCSPlayer.baseclass.localdata.m_iAmmo.010" es_xkeysetvalue gg_ammo_count "weapon_fiveseven" 200 es_xkeysetvalue gg_ammo_props "weapon_elite" "CCSPlayer.baseclass.localdata.m_iAmmo.006" es_xkeysetvalue gg_ammo_count "weapon_elite" 200 es_xkeysetvalue gg_ammo_props "weapon_m3" "CCSPlayer.baseclass.localdata.m_iAmmo.007" es_xkeysetvalue gg_ammo_count "weapon_m3" 200 es_xkeysetvalue gg_ammo_props "weapon_xm1014" "CCSPlayer.baseclass.localdata.m_iAmmo.007" es_xkeysetvalue gg_ammo_count "weapon_xm1014" 200 es_xkeysetvalue gg_ammo_props "weapon_tmp" "CCSPlayer.baseclass.localdata.m_iAmmo.006" es_xkeysetvalue gg_ammo_count "weapon_tmp" 200 es_xkeysetvalue gg_ammo_props "weapon_mac10" "CCSPlayer.baseclass.localdata.m_iAmmo.008" es_xkeysetvalue gg_ammo_count "weapon_mac10" 200 es_xkeysetvalue gg_ammo_props "weapon_mp5navy" "CCSPlayer.baseclass.localdata.m_iAmmo.006" es_xkeysetvalue gg_ammo_count "weapon_mp5navy" 200 es_xkeysetvalue gg_ammo_props "weapon_ump45" "CCSPlayer.baseclass.localdata.m_iAmmo.008" es_xkeysetvalue gg_ammo_count "weapon_ump45" 200 es_xkeysetvalue gg_ammo_props "weapon_p90" "CCSPlayer.baseclass.localdata.m_iAmmo.010" es_xkeysetvalue gg_ammo_count "weapon_p90" 200 es_xkeysetvalue gg_ammo_props "weapon_galil" "CCSPlayer.baseclass.localdata.m_iAmmo.003" es_xkeysetvalue gg_ammo_count "weapon_galil" 200 es_xkeysetvalue gg_ammo_props "weapon_famas" "CCSPlayer.baseclass.localdata.m_iAmmo.003" es_xkeysetvalue gg_ammo_count "weapon_famas" 200 es_xkeysetvalue gg_ammo_props "weapon_ak47" "CCSPlayer.baseclass.localdata.m_iAmmo.002" es_xkeysetvalue gg_ammo_count "weapon_ak47" 200 es_xkeysetvalue gg_ammo_props "weapon_scout" "CCSPlayer.baseclass.localdata.m_iAmmo.002" es_xkeysetvalue gg_ammo_count "weapon_scout" 200 es_xkeysetvalue gg_ammo_props "weapon_m4a1" "CCSPlayer.baseclass.localdata.m_iAmmo.003" es_xkeysetvalue gg_ammo_count "weapon_m4a1" 200 es_xkeysetvalue gg_ammo_props "weapon_sg552" "CCSPlayer.baseclass.localdata.m_iAmmo.003" es_xkeysetvalue gg_ammo_count "weapon_sg552" 200 es_xkeysetvalue gg_ammo_props "weapon_aug" "CCSPlayer.baseclass.localdata.m_iAmmo.002" es_xkeysetvalue gg_ammo_count "weapon_aug" 200 es_xkeysetvalue gg_ammo_props "weapon_awp" "CCSPlayer.baseclass.localdata.m_iAmmo.005" es_xkeysetvalue gg_ammo_count "weapon_awp" 0 es_xkeysetvalue gg_ammo_props "weapon_g3sg1" "CCSPlayer.baseclass.localdata.m_iAmmo.002" es_xkeysetvalue gg_ammo_count "weapon_g3sg1" 0 es_xkeysetvalue gg_ammo_props "weapon_sg550" "CCSPlayer.baseclass.localdata.m_iAmmo.003" es_xkeysetvalue gg_ammo_count "weapon_sg550" 0 es_xkeysetvalue gg_ammo_props "weapon_m249" "CCSPlayer.baseclass.localdata.m_iAmmo.004" es_xkeysetvalue gg_ammo_count "weapon_m249" 200 // init ammo variables es_xsetinfo gg_ammoname 0 es_xsetinfo gg_ammonum 0 // init tmp menu messages es_xsetinfo tmp_menumsg 0 // init vars es_xsetinfo p_wpn 0 es_xsetinfo p_wins 0 es_xsetinfo p_lvl 0 es_xsetinfo p_kills 0 es_xsetinfo p_team 0 es_xsetinfo tmp_leadermsg 0 es_xsetinfo user_x 0 es_xsetinfo user_y 0 es_xsetinfo user_z 0 es_xsetinfo dead_x 0 es_xsetinfo dead_y 0 es_xsetinfo victim_lvl 0 es_xsetinfo _tmp 0 es_xsetinfo _tmp2 0 es_xsetinfo _tmp3 0 es_xsetinfo oldescape 0 es_xsetinfo user_id 0 es_xsetinfo steam_id 0 es_xsetinfo gg_warmup_timer 0 es_xsetinfo gg_vote 0 es_xsetinfo tmp_c 0 es_xsetinfo tmp_d 0 es_xsetinfo tmp_e 0 es_xsetinfo gg_tmp 0 es_xsetinfo gg_equip 0 es_xsetinfo gg_auto_give 0 //################################################################################ // Create popup menus for Score, Weapons and Top 10 popup create Top10Page1 popup prepuser Top10Page1 gungame3/create_top10_popup popup timeout Top10Page1 view 10 // popup create ScorePage1 popup prepuser ScorePage1 gungame3/create_score_popup popup timeout ScorePage1 view 10 // popup create WeaponPage1 popup prepuser WeaponPage1 gungame3/create_weapon_popup popup timeout WeaponPage1 view 10 } block create_top10_popup { es_xsetinfo tmp_top10_playersonpage 0 es_xsetinfo tmp_top10listpages 0 es_xsetinfo tmp_top10_counter 0 es_xforeachkey tmp_top10_userid in gg_top10 "es_xdoblock gungame3/top10list_add" if (server_var(tmp_top10listpages) > 1) do { // Make the last page complete as well as link first page to last page es popup addline server_var(tmp_top10_popupname) "-----------" es popup addline server_var(tmp_top10_popupname) "->8. Prev page" es popup addline server_var(tmp_top10_popupname) "->9. First page" es popup addline server_var(tmp_top10_popupname) "->0. Exit" es_xmath tmp_top10listpages - 1 es_format tmp_temp "Top10Page%1" server_var(tmp_top10listpages) es popup submenu server_var(tmp_top10_popupname) 8 server_var(tmp_top10) es_xmath tmp_top10listpages + 1 es popup submenu server_var(tmp_top10_popupname) 9 Top10Page1 es popup modline Top10Page1 8 "->8. Last page" es popup submenu Top10Page1 8 server_var(tmp_top10_popupname) } else do { es popup addline server_var(tmp_top10_popupname) "-----------" es popup addline server_var(tmp_top10_popupname) "->0. Exit" } // Let's make a final touch by adding page numbering! es_xsetinfo tmp_looper 1 es_xdoblock gungame3/playerlist_page // since we built the list from beginning, let's add this creation again there popup prepuser Top10Page1 gungame3/create_top10_popup } block top10list_page { if (server_var(tmp_top10_looper) <= server_var(tmp_top10listpages)) do { es_format tmp_top10_popupname "Top10Page%1" server_var(tmp_top10_looper) es_format tmp_temp "Gun Game Top10 (%1/%2)" server_var(tmp_top10_looper) server_var(tmp_top10listpages) es popup modline server_var(tmp_top10_popupname) 1 server_var(tmp_top10) // next page es_xmath tmp_top10_looper + 1 es_xdoblock gungame3/top10list_page } } block top10list_add { // we will have maximum of 5 players per page, so let's see if we change pages if (server_var(tmp_top10_playersonpage) == 5) then es_xsetinfo tmp_top10_playersonpage 0 if (server_var(tmp_top10_playersonpage) == 0) do { es_xmath tmp_top10listpages + 1 if (server_var(tmp_top10listpages) > 1) do { es popup addline server_var(tmp_top10_popupname) "-----------" es popup addline server_var(tmp_top10_popupname) "->8. Prev page" es popup addline server_var(tmp_top10_popupname) "->9. Next page" es popup addline server_var(tmp_top10_popupname) "->0. Exit" es_xmath tmp_top10listpages - 2 es_format tmp_top10 "Top10Page%1" server_var(tmp_top10listpages) es popup submenu server_var(tmp_top10_popupname) 8 server_var(tmp_top10) es_xmath tmp_top10listpages + 2 es_format tmp_top10 "Top10Page%1" server_var(tmp_top10listpages) es popup submenu server_var(tmp_top10_popupname) 9 server_var(tmp_top10) } es_format tmp_top10_popupname "Top10Page%1" server_var(tmp_top10listpages) es popup create server_var(tmp_top10_popupname) es popup addline server_var(tmp_top10_popupname) "Gun Game Top10" } es_xsetinfo tmp_top10_playername 0 es_xsetinfo tmp_top10_playerwins 0 es_keygetvalue tmp_top10_playername gg_top10 server_var(tmp_top10_userid) name es_keygetvalue tmp_top10_playerwins gg_top10 server_var(tmp_top10_userid) wins es_xmath tmp_top10_playersonpage + 1 es_xmath tmp_top10_counter + 1 es_format tmp_top10 "->%1. Wins %2 %3" server_var(tmp_top10_counter) server_var(tmp_top10_playerwins) server_var(tmp_top10_playername) es popup addline server_var(tmp_top10_popupname) server_var(tmp_top10) } block unsendTop10Page { // this block will loop through all the player list menus and delete them if (server_var(tmp_top10_looper) <= server_var(tmp_top10listpages)) do { es_format tmp_top10_popupname "Top10Page%1" server_var(tmp_top10_looper) es popup unsendname server_var(tmp_top10_popupname) #all es popup delete server_var(tmp_top10_popupname) // Loop to the next page es_xmath tmp_top10_looper + 1 es_xdoblock gungame3/unsendTop10Page } } block create_weapon_popup { es_xsetinfo tmp_wepsonpage 0 es_xsetinfo tmp_weplistpages 0 es_xforeachkey tmp_weplevel in gg_weapons "es_xdoblock gungame3/weaponlist_add" if (server_var(tmp_weplistpages) > 1) do { // Make the last page complete as well as link first page to last page es popup addline server_var(tmp_weppopup) "-----------" es popup addline server_var(tmp_weppopup) "->8. Prev page" es popup addline server_var(tmp_weppopup) "->9. First page" es popup addline server_var(tmp_weppopup) "->0. Exit" es_xmath tmp_weplistpages - 1 es_format tmp_weptemp "WeaponPage%1" server_var(tmp_weplistpages) es popup submenu server_var(tmp_weppopup) 8 server_var(tmp_weptemp) es_xmath tmp_weplistpages + 1 es popup submenu server_var(tmp_weppopup) 9 WeaponPage1 es popup modline WeaponPage1 13 "->8. Last page" es popup submenu WeaponPage1 8 server_var(tmp_weppopup) } else do { es popup addline server_var(tmp_weppopup) "-----------" es popup addline server_var(tmp_weppopup) "->0. Exit" } // Let's make a final touch by adding page numbering! es_xsetinfo tmp_weplooper 1 es_xdoblock gungame3/weaponlist_page // since we built the list from beginning, let's add this creation again there popup prepuser WeaponPage1 gungame3/create_weapon_popup } block weaponlist_page { if (server_var(tmp_weplooper) <= server_var(tmp_weplistpages)) do { es_format tmp_weppopup "WeaponPage%1" server_var(tmp_weplooper) es_format tmp_weptemp "Gun Game Weapons (%1/%2)" server_var(tmp_weplooper) server_var(tmp_weplistpages) es popup modline server_var(tmp_weppopup) 1 server_var(tmp_weptemp) // next page es_xmath tmp_weplooper + 1 es_xdoblock gungame3/weaponlist_page } } block weaponlist_add { // we will have maximum of 10 weapons per page, so let's see if we change pages if (server_var(tmp_wepsonpage) == 10) then es_xsetinfo tmp_wepsonpage 0 if (server_var(tmp_wepsonpage) == 0) do { es_xmath tmp_weplistpages + 1 if (server_var(tmp_weplistpages) > 1) do { es popup addline server_var(tmp_weppopup) "-----------" es popup addline server_var(tmp_weppopup) "->8. Prev page" es popup addline server_var(tmp_weppopup) "->9. Next page" es popup addline server_var(tmp_weppopup) "->0. Exit" es_xmath tmp_weplistpages - 2 es_format tmp_weptemp "WeaponPage%1" server_var(tmp_weplistpages) es popup submenu server_var(tmp_weppopup) 8 server_var(tmp_weptemp) es_xmath tmp_weplistpages + 2 es_format tmp_weptemp "WeaponPage%1" server_var(tmp_weplistpages) es popup submenu server_var(tmp_weppopup) 9 server_var(tmp_weptemp) } es_format tmp_weppopup "WeaponPage%1" server_var(tmp_weplistpages) es popup create server_var(tmp_weppopup) es popup addline server_var(tmp_weppopup) "Gun Game Weapons" } es_xsetinfo tmp_wepname 0 es_keygetvalue tmp_wepname gg_weapons server_var(tmp_weplevel) weapon es_xmath tmp_wepsonpage + 1 es_format tmp_weptemp "->%1. %2" server_var(tmp_weplevel) server_var(tmp_wepname) es popup addline server_var(tmp_weppopup) server_var(tmp_weptemp) } block unsendWeaponPage { // this block will loop through all the player list menus and delete them if (server_var(tmp_weplooper) <= server_var(tmp_weplistpages)) do { es_format tmp_weppopup "WeaponPage%1" server_var(tmp_weplooper) es popup unsendname server_var(tmp_weppopup) #all es popup delete server_var(tmp_weppopup) // Loop to the next page es_xmath tmp_weplooper + 1 es_xdoblock gungame3/unsendWeaponPage } } block create_score_popup { es_xsetinfo tmp_playersonpage 0 es_xsetinfo tmp_playerlistpages 0 es_xsetinfo tmp_player 0 es_xforeachkey tmp_userid in gg_players "es_xdoblock gungame3/playerlist_add" if (server_var(tmp_playerlistpages) > 1) do { // Make the last page complete as well as link first page to last page es popup addline server_var(tmp_popupname) "-----------" es popup addline server_var(tmp_popupname) "->8. Prev page" es popup addline server_var(tmp_popupname) "->9. First page" es popup addline server_var(tmp_popupname) "->0. Exit" es_xmath tmp_playerlistpages - 1 es_format tmp_temp "ScorePage%1" server_var(tmp_playerlistpages) es popup submenu server_var(tmp_popupname) 8 server_var(tmp_temp) es_xmath tmp_playerlistpages + 1 es popup submenu server_var(tmp_popupname) 9 ScorePage1 es popup modline ScorePage1 8 "->8. Last page" es popup submenu ScorePage1 8 server_var(tmp_popupname) } else do { es popup addline server_var(tmp_popupname) "-----------" es popup addline server_var(tmp_popupname) "->0. Exit" } // Let's make a final touch by adding page numbering! es_xsetinfo tmp_looper 1 es_xdoblock gungame3/playerlist_page // since we built the list from beginning, let's add this creation again there popup prepuser ScorePage1 gungame3/create_score_popup } block playerlist_page { if (server_var(tmp_looper) <= server_var(tmp_playerlistpages)) do { es_format tmp_popupname "ScorePage%1" server_var(tmp_looper) es_format tmp_temp "Gun Game Scores (%1/%2)" server_var(tmp_looper) server_var(tmp_playerlistpages) es popup modline server_var(tmp_popupname) 1 server_var(tmp_temp) // next page es_xmath tmp_looper + 1 es_xdoblock gungame3/playerlist_page } } block playerlist_add { // we will have maximum of 5 players per page, so let's see if we change pages if (server_var(tmp_playersonpage) == 5) then es_xsetinfo tmp_playersonpage 0 if (server_var(tmp_playersonpage) == 0) do { es_xmath tmp_playerlistpages + 1 if (server_var(tmp_playerlistpages) > 1) do { es popup addline server_var(tmp_popupname) "-----------" es popup addline server_var(tmp_popupname) "->8. Prev page" es popup addline server_var(tmp_popupname) "->9. Next page" es popup addline server_var(tmp_popupname) "->0. Exit" es_xmath tmp_playerlistpages - 2 es_format tmp_temp "ScorePage%1" server_var(tmp_playerlistpages) es popup submenu server_var(tmp_popupname) 8 server_var(tmp_temp) es_xmath tmp_playerlistpages + 2 es_format tmp_temp "ScorePage%1" server_var(tmp_playerlistpages) es popup submenu server_var(tmp_popupname) 9 server_var(tmp_temp) } es_format tmp_popupname "ScorePage%1" server_var(tmp_playerlistpages) es popup create server_var(tmp_popupname) es popup addline server_var(tmp_popupname) "Gun Game Scores" } es_xsetinfo tmp_playername 0 es_xsetinfo tmp_playerlevel 0 es_xsetinfo tmp_playerwins 0 es_keygetvalue tmp_playername gg_players server_var(tmp_userid) name es_keygetvalue tmp_playerlevel gg_players server_var(tmp_userid) level es_keygetvalue tmp_playerwins gg_players server_var(tmp_userid) wins es_xmath tmp_playersonpage + 1 es_xmath tmp_player + 1 if (server_var(tmp_playerlevel) == server_var(ldr_level)) do { es_format tmp_temp "->%1. **Level %2 Wins %3 %4" server_var(tmp_player) server_var(tmp_playerlevel) server_var(tmp_playerwins) server_var(tmp_playername) } else do { es_format tmp_temp "->%1. Level %2 Wins %3 %4" server_var(tmp_player) server_var(tmp_playerlevel) server_var(tmp_playerwins) server_var(tmp_playername) } es popup addline server_var(tmp_popupname) server_var(tmp_temp) } block unsendScorePage { // this block will loop through all the player list menus and delete them if (server_var(tmp_looper) <= server_var(tmp_playerlistpages)) do { es_format tmp_popupname "ScorePage%1" server_var(tmp_looper) es popup unsendname server_var(tmp_popupname) #all es popup delete server_var(tmp_popupname) // Loop to the next page es_xmath tmp_looper + 1 es_xdoblock gungame3/unsendScorePage } } block gg_set_level { es_xgetargv tmp_c 1 es_xgetargv tmp_d 2 es_getuserid tmp_e server_var(tmp_c) if (server_var(tmp_e) > 0) do { if (server_var(tmp_d) > 0) do { if (server_var(tmp_d) <= server_var(gg_levels)) do { es_keysetvalue gg_players server_var(tmp_e) level server_var(tmp_d) if (server_var(tmp_d) > server_var(ldr_level)) then es_xcopy ldr_level tmp_d es_log [GunGame] gg_setlevel: Userid server_var(tmp_e) was set to level server_var(tmp_d) } else do { es_log [GunGame] gg_setlevel: Level must be between 1 and server_var(gg_levels): server_var(tmp_d) } } else do { es_log [GunGame] gg_setlevel: Level must be between 1 and server_var(gg_levels): server_var(tmp_d) } } else do { es_log [GunGame] gg_setlevel: server_var(tmp_c) is not a valid USER! } } block player_setup { ///////////////////////////////////// // Open gg_winners db if (server_var(win_db_open) == 0) do { es_xexists gg_exists keygroup gg_winners if (server_var(gg_exists) == 1) then es_xkeygroupdelete gg_winners es_xkeygroupcreate gg_winners es_keygroupload gg_winners server_var(gg_dir) es_xsetinfo win_db_open 1 } es_xmath gg_read_write + 1 /////////////////////// // gg_winners actions / /////////////////////// // // Variables es_xsetinfo p_level 0 es_xsetinfo s_wins 0 // Setup new player in gg_players db es_keycreate gg_players event_var(userid) es_keysetvalue gg_players event_var(userid) name event_var(es_username) es uniqueid p_steamid event_var(userid) 1 es_keysetvalue gg_players event_var(userid) steamid server_var(p_steamid) es_keysetvalue gg_players event_var(userid) level 1 es_keysetvalue gg_players event_var(userid) levelup 0 es_keysetvalue gg_players event_var(userid) kills 0 es_keysetvalue gg_players event_var(userid) afk 0 // Bring over user wins from gg_winners es_keygetvalue s_wins gg_winners server_var(p_steamid) wins es_keysetvalue gg_players event_var(userid) wins server_var(s_wins) // Save and close gg_winners es_xmath gg_read_write - 1 if (server_var(gg_read_write) == 0) do { if (server_var(win_db_open) == 1) do { es_keygroupsave gg_winners server_var(gg_dir) es_xkeygroupdelete gg_winners es_xsetinfo win_db_open 0 } } //gg_winners closed ////////////////////////////////////////// // add player to afk_db es_keydelete afk_db event_var(userid) es_keycreate afk_db event_var(userid) // If player is reconnecting, give previous level es_xsetinfo p_level 0 es_xsetinfo skip_handicap 0 // Check to see if player has already connected to the current map es_keygetvalue p_level lvl_db server_var(p_steamid) level // If player has already connected, give back player's level upon disconnecting if (server_var(p_level) > 0) do { es_keysetvalue gg_players event_var(userid) level server_var(p_level) es_xsetinfo skip_handicap 1 } // Execute handicap code if (server_var(skip_handicap) == 0) do { if (server_var(gg_handicap_on) == 1) do { es_xdoblock gungame3/gg_handicap } } // Add player to gg_pref db es_exists gg_exists key gg_pref server_var(p_steamid) if (server_var(gg_exists) != 1) do { es_keycreate gg_pref server_var(p_steamid) es_keysetvalue gg_pref server_var(p_steamid) auto_give 1 es_keysetvalue gg_players event_var(userid) auto_give 1 } else do { es_keygetvalue gg_auto_give gg_pref server_var(p_steamid) auto_give es_keysetvalue gg_players event_var(userid) auto_give server_var(gg_auto_give) } // Remove player from lvl_db es_keydelete lvl_db server_var(p_steamid) } block player_setup_in_progress { es_xsetinfo gg_tmp_n 0 es_xsetinfo gg_tmp_s 0 es_keygetvalue gg_tmp_n gg_player_list server_var(key_x) name es uniqueid gg_tmp_s server_var(key_x) 1 ///////////////////////////////////// // Open gg_winners db if (server_var(win_db_open) == 0) do { es_xexists gg_exists keygroup gg_winners if (server_var(gg_exists) == 1) then es_xkeygroupdelete gg_winners es_xkeygroupcreate gg_winners es_keygroupload gg_winners server_var(gg_dir) es_xsetinfo win_db_open 1 } es_xmath gg_read_write + 1 /////////////////////// // gg_winners actions / /////////////////////// // // Variables es_xsetinfo p_level 0 es_xsetinfo s_wins 0 es_keycreate gg_players server_var(key_x) es_keysetvalue gg_players server_var(key_x) name server_var(gg_tmp_n) es_keysetvalue gg_players server_var(key_x) steamid server_var(gg_tmp_s) es_keysetvalue gg_players server_var(key_x) level 1 es_keysetvalue gg_players server_var(key_x) levelup 0 es_keysetvalue gg_players server_var(key_x) kills 0 es_keysetvalue gg_players server_var(key_x) afk 0 // Bring over user wins from gg_winners es_keygetvalue s_wins gg_winners server_var(gg_tmp_s) wins es_keysetvalue gg_players server_var(key_x) wins server_var(s_wins) // Save and close gg_winners es_xmath gg_read_write - 1 if (server_var(gg_read_write) == 0) do { if (server_var(win_db_open) == 1) do { es_keygroupsave gg_winners server_var(gg_dir) es_xkeygroupdelete gg_winners es_xsetinfo win_db_open 0 } } //gg_winners closed ////////////////////////////////////////// // add player to afk_db es_keydelete afk_db server_var(key_x) es_keycreate afk_db server_var(key_x) // Add player to gg_pref db or get gg_pref settings es_exists gg_exists key gg_pref server_var(gg_tmp_s) if (server_var(gg_exists) != 1) do { es_keycreate gg_pref server_var(gg_tmp_s) es_keysetvalue gg_pref server_var(gg_tmp_s) auto_give 1 es_keysetvalue gg_players server_var(key_x) auto_give 1 } else do { es_keygetvalue gg_auto_give gg_pref server_var(gg_tmp_s) auto_give es_keysetvalue gg_players server_var(key_x) auto_give server_var(gg_auto_give) } // Execute handicap code if (server_var(skip_handicap) == 0) do { if (server_var(gg_handicap_on) == 1) do { es_xdoblock gungame3/gg_handicap_in_progress } } } event es_map_start { // Load sounds into downloadables es_xsetinfo gg_tmp_sound 0 es_format gg_tmp_sound "sound/%1" server_var(gg_sound_welcome) es downloadable server_var(gg_tmp_sound) es_format gg_tmp_sound "sound/%1" server_var(gg_sound_knife) es downloadable server_var(gg_tmp_sound) es_format gg_tmp_sound "sound/%1" server_var(gg_sound_nade) es downloadable server_var(gg_tmp_sound) es_format gg_tmp_sound "sound/%1" server_var(gg_sound_levelup) es downloadable server_var(gg_tmp_sound) es_format gg_tmp_sound "sound/%1" server_var(gg_sound_leveldown) es downloadable server_var(gg_tmp_sound) es_format gg_tmp_sound "sound/%1" server_var(gg_sound_levelsteal) es downloadable server_var(gg_tmp_sound) es_format gg_tmp_sound "sound/%1" server_var(gg_sound_triple) es downloadable server_var(gg_tmp_sound) es_format gg_tmp_sound "sound/%1" server_var(gg_sound_warning) es downloadable server_var(gg_tmp_sound) if (server_var(gg_rand_song) == 0) do { if (server_var(gg_sound_winner) != "music/HL2_song15.mp3") do { es_format gg_tmp_sound "sound/%1" server_var(gg_sound_winner) es downloadable server_var(gg_tmp_sound) } } if (server_var(gg_sound_kill) != "common/stuck1.wav") do { es_format gg_tmp_sound "sound/%1" server_var(gg_sound_kill) es downloadable server_var(gg_tmp_sound) } // Warmup timer es_xcopy gg_warmup_timer gg_warmup_timer_setting // End of map vote es_xcopy gg_vote gg_vote_setting // Gun Game map presets es_xdelayed 2 gg_map_setup // Erase leader weapon and level from previous map es_xsetinfo ldr_weapon 0 es_xsetinfo ldr_level 1 // afk database keygroupremove afk_db es_xkeygroupcreate afk_db // level db for reconnecting players keygroupremove lvl_db es_xkeygroupcreate lvl_db // gg_players database keygroupremove gg_players es_xkeygroupcreate gg_players // Warmup round code alias warmup_countdown "es_xmath gg_warmup_timer - 1; if (server_var(gg_warmup_timer) == 1) then warmup_over; es_centermsg Warmup round: server_var(gg_warmup_timer) seconds left; if (server_var(gg_warmup_timer) > 1) then es_xdelayed 1 warmup_countdown" alias warmup_over "es_xsetinfo dm_started 0; mp_restartgame 1; es_xdelayed .99 es_xforeachkey test in gg_players warmup_reset; es_xdelayed 1 es_xsetinfo ldr_level 1" alias warmup_reset "es_keysetvalue gg_players server_var(test) level 1" if (server_var(gg_warmup_timer) > 0) then warmup_countdown } block create_weapon_list { es_token gg_tmp_weapon server_var(gg_weapon_order) server_var(gg_level_counter) , es_keycreate gg_weapons server_var(gg_level_counter) es_keysetvalue gg_weapons server_var(gg_level_counter) weapon server_var(gg_tmp_weapon) es_xmath gg_level_counter + 1 if (server_var(gg_level_counter) <= server_var(gg_levels)) then es_xdoblock gungame3/create_weapon_list } block gg_set_weapon_order { es_xsetinfo gg_tmp_weapon_order 0 es_xsetinfo _tmp 0 es_xgetargs gg_tmp_weapon_order es_xexists _tmp variable gg_weapon_order_old if (server_var(_tmp) == 0) do { es_xsetinfo gg_weapon_order_old 0 es_xcopy gg_weapon_order_old gg_weapon_order } if (server_var(gg_tmp_weapon_order) != 0) do { if (server_var(gg_tmp_weapon_order) == "default") do { es_xcopy gg_weapon_order gg_weapon_order_old } else do { es_setinfo gg_weapon_order server_var(gg_tmp_weapon_order) } // Create weapon list es_xsetinfo gg_tmp_weapon 0 es_xsetinfo gg_levels 0 es_token gg_levels server_var(gg_weapon_order) 0 , es_xexists gg_exists keygroup gg_weapons if (server_var(gg_exists) == 1) then es_xkeygroupdelete gg_weapons es_xkeygroupcreate gg_weapons es_xsetinfo gg_level_counter 1 if (server_var(gg_levels) > 0) then es_xdoblock gungame3/create_weapon_list // Dynamic level total - 1 es_setinfo gg_level_dynamic server_var(gg_levels) es_xmath gg_level_dynamic - 1 es_log [GunGame] Weapon order reset to: server_var(gg_weapon_order) es_xlog [GunGame] Restarting map... es_xmsg #green Changing weapon order... es_xmsg #green Changing weapon order... es_xmsg #green Restart in 3 seconds... mp_restartgame 3 es_xdelayed 2.95 es_xforeachkey test in gg_players warmup_reset } else do { echo gg_setweapons: not enough arguments - Syntax: gg_setweapons ,, } } block create_top10 { es_keycreate gg_top10 server_var(top10_counter) es_keysetvalue gg_top10 server_var(top10_counter) name none es_keysetvalue gg_top10 server_var(top10_counter) wins 0 if (server_var(top10_counter) == 10) do { es_keysetvalue gg_top10 server_var(top10_counter) steam 1 } else do { es_keysetvalue gg_top10 server_var(top10_counter) steam 0 } es_xmath top10_counter + 1 if (server_var(top10_counter) < 11) then es_xdoblock gungame3/create_top10 if (server_var(top10_counter) == 11) then es_xkeygroupsave gg_top10 server_var(gg_dir) } event player_activate { es_xdoblock gungame3/player_setup } event bomb_pickup { if (server_var(gg_obj_remove) != 1) do { // Set bomber es_setinfo bomber event_var(userid) } } event bomb_planted { // Reset bomber es_xsetinfo bomber 0 } event bomb_dropped { // Reset bomber es_xsetinfo bomber 0 } event player_team { if (server_var(gg_join_msg) == 1) do { // Join message if (event_var(disconnect) != 1) do { es_xsetinfo gg_join_msg_do 0 es_keygetvalue gg_join_msg_do gg_players event_var(userid) join_msg if (server_var(gg_join_msg_do) == 0) do { es_xsetinfo message_counter 0 // Welcome message es_xsetinfo tmp_menumsg "This server is running the Gun Game\n_______________\n" if (server_var(gg_knife_pro) == 1) do { es_xmath message_counter + 1 es_format tmp_menumsg "%1->%2. Knife Pro is ENABLED!!\n" server_var(tmp_menumsg) server_var(message_counter) } if (server_var(gg_turbo) == 1) do { es_xmath message_counter + 1 es_format tmp_menumsg "%1->%2. Turbo Mode is ENABLED!!\n" server_var(tmp_menumsg) server_var(message_counter) } if (server_var(gg_knife_elite) == 1) do { es_xmath message_counter + 1 es_format tmp_menumsg "%1->%2. Knife Elite Mode is ENABLED!!\n" server_var(tmp_menumsg) server_var(message_counter) } if (server_var(gg_multikill) > 1) do { es_xmath message_counter + 1 es_format tmp_menumsg "%1->%2. Multikill Mode is ENABLED!! %3 kills required\n" server_var(tmp_menumsg) server_var(message_counter) server_var(gg_multikill) } if (server_var(gg_dm_script) == 1) do { es_xmath message_counter + 1 es_format tmp_menumsg "%1->%2. Deathmatch Addon is ENABLED!!\n" server_var(tmp_menumsg) server_var(message_counter) if (server_var(gg_dm_spawn_protect) > 0) do { es_format tmp_menumsg "%1 - Spawn protection: %2 seconds\n" server_var(tmp_menumsg) server_var(gg_dm_spawn_protect) } } es_format tmp_menumsg "%1---------------\nType !rules for instructions on how to play and a list of commands\nType !level to get your level info and who is leading\nType !score to get a list of all players scores and winnings\n \n->0. Exit" server_var(tmp_menumsg) es_menu 0 event_var(userid) server_var(tmp_menumsg) es_keysetvalue gg_players event_var(userid) join_msg 1 // Player join gungame sound es_cexec event_var(userid) play server_var(gg_sound_welcome) } } } } event player_spawn { //removes weapons es_give event_var(userid) player_weaponstrip es_fire event_var(userid) player_weaponstrip Strip 1 //removes cash es_setplayerprop event_var(userid) CCSPlayer.m_iAccount 0 // have the player initialize if (event_var(es_steamid) == "BOT") do { // If warmup is over, or knife warmup is off, give weapons if (server_var(gg_knife_warmup) == 1) do { if (server_var(gg_warmup_timer) < 2) then es_xdoblock gungame3/bot_spawn if (server_var(gg_warmup_timer) > 1) do { es_delayed 1 es_xgive event_var(userid) item_assaultsuit es_delayed 1 es_xgive event_var(userid) weapon_knife } } else do { es_xdoblock gungame3/bot_spawn } } else do { if (event_var(es_userteam) > 1) then es_xdelayed .5 gg_start_round event_var(userid) } } event player_death { // Set attacker's cash back to 0 so they can't buy from the $300 they got for killing the player. es_setplayerprop event_var(attacker) CCSPlayer.m_iAccount 0 // afk_db get player death location es_xsetinfo user_afk 0 if (event_var(es_steamid) != "BOT") do { es_xsetinfo user_x 0 es_xsetinfo user_y 0 es_xsetinfo user_z 0 es_getplayerlocation user_x user_y user_z event_var(userid) es_xsetinfo dead_x 0 es_xsetinfo dead_y 0 es_keygetvalue dead_x afk_db event_var(userid) x es_keygetvalue dead_y afk_db event_var(userid) y if (server_var(user_x) == server_var(dead_x)) do { if (server_var(user_y) == server_var(dead_y)) do { es_xsetinfo user_afk 1 es keymath gg_players event_var(userid) afk + 1 if (server_var(gg_afk_deaths) > 0) do { if (server_var(_keymathmathvar) >= server_var(gg_afk_deaths)) do { if (server_var(gg_afk_action) == 1) then es kickid event_var(userid) "AFK too long." if (server_var(gg_afk_action) == 2) then es_xfire event_var(userid) !self setteam 1 } } } else do { es_keysetvalue gg_players event_var(userid) afk 0 } } else do { es_keysetvalue gg_players event_var(userid) afk 0 } } // Setup for Multi Kill mode if (server_var(gg_multikill) > 1) do { es_keygetvalue p_kills gg_players event_var(attacker) kills } if (event_var(attacker) != 0) do { es_keygetvalue p_lvl gg_players event_var(attacker) level es_keygetvalue p_wpn gg_weapons server_var(p_lvl) weapon } es_keygetvalue victim_lvl gg_players event_var(userid) level if (event_var(es_userteam) != event_var(es_attackerteam)) do { if (server_var(user_afk) == 0) do { if (event_var(weapon) == server_var(p_wpn)) do { if (server_var(gg_multikill) < 2) do { es_xdoblock gungame3/gg_levelup // Log level up for hlstats users es_xsetinfo _tmp 0 es_xsetinfo _tmp2 0 es_xsetinfo oldescape 0 es_xcopy oldescape eventscripts_escapechars if (event_var(es_attackerteam) == 2) then es_xsetinfo _tmp "TERRORIST" if (event_var(es_attackerteam) == 3) then es_xsetinfo _tmp "CT" es_format _tmp2 "%1<%2><%3><%4>" event_var(es_attackername) event_var(attacker) event_var(es_attackersteamid) server_var(_tmp) es_xsetinfo eventscripts_escapechars "; {}()':l" es_logq server_var(_tmp2) triggered gg_levelup es_xcopy eventscripts_escapechars oldescape } else do { es_xmath p_kills + 1 if (server_var(p_wpn) == "hegrenade") then es_xcopy p_kills gg_multikill if (server_var(p_wpn) == "knife") then es_xcopy p_kills gg_multikill if (server_var(p_kills) == server_var(gg_multikill)) do { es_xdoblock gungame3/gg_levelup // Log level up for hlstats users es_xcopy oldescape eventscripts_escapechars if (event_var(es_attackerteam) == 2) then es_xsetinfo _tmp "TERRORIST" if (event_var(es_attackerteam) == 3) then es_xsetinfo _tmp "CT" es_format _tmp2 "%1<%2><%3><%4>" event_var(es_attackername) event_var(attacker) event_var(es_attackersteamid) server_var(_tmp) es_xsetinfo eventscripts_escapechars "; {}()':l" es_logq server_var(_tmp2) triggered gg_levelup es_xcopy eventscripts_escapechars oldescape } else do { es_keysetvalue gg_players event_var(attacker) kills server_var(p_kills) es_cexec event_var(attacker) play server_var(gg_sound_kill) // HUD hint message es_fire event_var(attacker) env_hudhint kill es_give event_var(attacker) env_hudhint es_format tmp_menumsg "message Required kills: %1/%2" server_var(p_kills) server_var(gg_multikill) es_fire event_var(attacker) env_hudhint AddOutput server_var(tmp_menumsg) es_fire event_var(attacker) env_hudhint ShowHudHint } } } else do { // Give extra nades to players on nade level when they get a kill if (server_var(gg_extra_nades) == 1) do { if (server_var(p_wpn) == "hegrenade") do { es_give event_var(attacker) weapon_hegrenade } } if (event_var(weapon) == "knife") do { if (server_var(gg_knife_warmup) == 1) do { if (server_var(gg_warmup_timer) < 2) do { if (server_var(gg_knife_pro) == 1) do { if (server_var(user_afk) == 0) do { es_xmath victim_lvl - 1 if (server_var(victim_lvl) > 0) do { es_keysetvalue gg_players event_var(userid) level server_var(victim_lvl) } es_keysetvalue gg_players event_var(userid) kills 0 //es_msg #green event_var(es_attackername) stole a level from event_var(es_username) es_cexec event_var(userid) play server_var(gg_sound_leveldown) es_cexec event_var(attacker) play server_var(gg_sound_levelsteal) if (server_var(p_wpn) != "hegrenade") then es_xdoblock gungame3/gg_levelup // Log level steal for hlstats users es_xsetinfo _tmp 0 es_xsetinfo _tmp2 0 es_xsetinfo oldescape 0 es_xcopy oldescape eventscripts_escapechars if (event_var(es_attackerteam) == 2) then es_xsetinfo _tmp "TERRORIST" if (event_var(es_attackerteam) == 3) then es_xsetinfo _tmp "CT" es_format _tmp2 "%1<%2><%3><%4>" event_var(es_attackername) event_var(attacker) event_var(es_attackersteamid) server_var(_tmp) es_xsetinfo eventscripts_escapechars "; {}()':l" es_logq server_var(_tmp2) triggered gg_levelsteal es_xcopy eventscripts_escapechars oldescape // Log level down for hlstats users es_xcopy oldescape eventscripts_escapechars if (event_var(es_userteam) == 2) then es_xsetinfo _tmp "TERRORIST" if (event_var(es_userteam) == 3) then es_xsetinfo _tmp "CT" es_format _tmp2 "%1<%2><%3><%4>" event_var(es_username) event_var(userid) event_var(es_steamid) server_var(_tmp) es_xsetinfo eventscripts_escapechars "; {}()':l" es_logq server_var(_tmp2) triggered gg_leveldown es_xcopy eventscripts_escapechars oldescape } } } } else do { if (server_var(gg_knife_pro) == 1) do { if (server_var(user_afk) == 0) do { es_xmath victim_lvl - 1 if (server_var(victim_lvl) > 0) do { es_keysetvalue gg_players event_var(userid) level server_var(victim_lvl) } es_keysetvalue gg_players event_var(userid) kills 0 //es_msg #green event_var(es_attackername) stole a level from event_var(es_username) es_cexec event_var(userid) play server_var(gg_sound_leveldown) es_cexec event_var(attacker) play server_var(gg_sound_levelsteal) if (server_var(p_wpn) != "hegrenade") then es_xdoblock gungame3/gg_levelup // Log level steal for hlstats users es_xsetinfo _tmp 0 es_xsetinfo _tmp2 0 es_xsetinfo oldescape 0 es_xcopy oldescape eventscripts_escapechars if (event_var(es_attackerteam) == 2) then es_xsetinfo _tmp "TERRORIST" if (event_var(es_attackerteam) == 3) then es_xsetinfo _tmp "CT" es_format _tmp2 "%1<%2><%3><%4>" event_var(es_attackername) event_var(attacker) event_var(es_attackersteamid) server_var(_tmp) es_xsetinfo eventscripts_escapechars "; {}()':l" es_logq server_var(_tmp2) triggered gg_levelsteal es_xcopy eventscripts_escapechars oldescape // Log level down for hlstats users es_xcopy oldescape eventscripts_escapechars if (event_var(es_userteam) == 2) then es_xsetinfo _tmp "TERRORIST" if (event_var(es_userteam) == 3) then es_xsetinfo _tmp "CT" es_format _tmp2 "%1<%2><%3><%4>" event_var(es_username) event_var(userid) event_var(es_steamid) server_var(_tmp) es_xsetinfo eventscripts_escapechars "; {}()':l" es_logq server_var(_tmp2) triggered gg_leveldown es_xcopy eventscripts_escapechars oldescape } } } } } } else do { es_format tmp_menumsg "%1 was AFK\n Your kill did not count!!" event_var(es_username) es_menu 5 event_var(attacker) server_var(tmp_menumsg) es_keysetvalue afk_db event_var(userid) x 1 //es_keysetvalue afk_db event_var(userid) y 1 } } if (server_var(suicide_protect) == 0) do { if (event_var(userid) == event_var(attacker)) do { es_xdoblock gungame3/gg_suicide } if (server_var(worldspawn_suicide) == 1) do { if (event_var(attacker) == 0) do { es_xdoblock gungame3/gg_worldspawn } } } } block gg_levelup { if (server_var(p_lvl) == server_var(gg_levels)) do { if (event_var(es_attackersteamid) != "BOT") do { // Allow only one winner if (server_var(gg_one_winner) == 0) do { // Log winner for hlstats users es_xsetinfo _tmp 0 es_xsetinfo _tmp2 0 es_xsetinfo oldescape 0 es_xcopy oldescape eventscripts_escapechars if (event_var(es_attackerteam) == 2) then es_xsetinfo _tmp "TERRORIST" if (event_var(es_attackerteam) == 3) then es_xsetinfo _tmp "CT" es_format _tmp2 "%1<%2><%3><%4>" event_var(es_attackername) event_var(attacker) event_var(es_attackersteamid) server_var(_tmp) es_xsetinfo eventscripts_escapechars "; {}()':w" es_logq server_var(_tmp2) triggered gg_win es_xcopy eventscripts_escapechars oldescape es_xsetinfo gg_one_winner 1 es_cexec_all play server_var(gg_sound_winner) // Tally votes and set next map for Eventscripts map voting if (server_var(gg_vote_setting) = 2) do { es_xdoblock gungame3/gg_voting/tally_vote if (server_var(gg_nextmap) != 0) then nextlevel server_var(gg_nextmap) } es_xexists gg_tmp variable mani_nextmap if (server_var(gg_tmp) == 1) do { es foreach player gg_tmp #all "es_toptext server_var(gg_tmp) 5 #red event_var(es_attackername) won! Nextmap: server_var(mani_nextmap)" es_msg #multi #green event_var(es_attackername) #lightgreen won! #default Nextmap: server_var(mani_nextmap) es_msg #multi #green event_var(es_attackername) #lightgreen won! #default Nextmap: server_var(mani_nextmap) } else do { if (server_var(gg_vote_setting) == 2) do { if (server_var(gg_nextmap) != 0) do { es foreach player gg_tmp #all "es_toptext server_var(gg_tmp) 5 #red event_var(es_attackername) won! Nextmap: server_var(gg_nextmap)" es_msg #multi #green event_var(es_attackername) #lightgreen won! #default Nextmap: server_var(gg_nextmap) es_msg #multi #green event_var(es_attackername) #lightgreen won! #default Nextmap: server_var(gg_nextmap) } } else do { es foreach player gg_tmp #all "es_toptext server_var(gg_tmp) 5 #red event_var(es_attackername) won!" es_msg #multi #green event_var(es_attackername) #lightgreen won! es_msg #multi #green event_var(es_attackername) #lightgreen won! } } es_setinfo winner_name event_var(es_attackername) es uniqueid p_steamid event_var(es_attackersteamid) 1 es_setinfo winner_steam server_var(p_steamid) es_xdoblock gungame3/gg_winner // End map es sv_alltalk 1 es_give event_var(attacker) game_end es_fire event_var(attacker) game_end EndGame es_xdoblock gungame3/winner_reset } } else do { es_msg #multi #green event_var(es_attackername) #lightgreen won! es_xmsg Game will continue until a human player wins. es_xrand _tmp 1 4 es_xmathparse _tmp2 "gg_levels - _tmp" es_keysetvalue gg_players event_var(attacker) level server_var(_tmp2) } } else do { // Reset kill count for multikill es_keysetvalue gg_players event_var(attacker) kills 0 if (server_var(gg_knife_elite) == 1) do { if (server_var(suicide_protect) != 1) do { // Set value showing player leveled up this round es_keysetvalue gg_players event_var(attacker) levelup 1 //removes weapons es_give event_var(attacker) player_weaponstrip es_fire event_var(attacker) player_weaponstrip Strip 1 es_delayed .3 es_xgive event_var(attacker) weapon_knife if (server_var(bomber) == event_var(attacker)) then es_xdelayed .5 es_xgive event_var(attacker) weapon_c4 if (server_var(gg_dm_script) != 1) do { if (event_var(es_attackerteam) == 3) do { es_delayed 1 es_xsetplayerprop event_var(attacker) CCSPlayer.m_bHasDefuser 1 } } } } if (server_var(gg_turbo) == 1) do { if (server_var(gg_knife_warmup) == 1) do { if (server_var(gg_warmup_timer) < 2) do { // Disable auto_give menu function for victim es_keysetvalue gg_players event_var(userid) turbo_equip 0 es_xmath p_lvl + 1 es_keysetvalue gg_players event_var(attacker) level server_var(p_lvl) es_keygetvalue gg_auto_give gg_players event_var(attacker) auto_give //re-equips weapons //es_xdoblock gungame3/give_turbo_weapon if (server_var(gg_auto_give) == 1) do { es gg_turbo_equip event_var(attacker) } else do { es_keysetvalue gg_players event_var(attacker) turbo_equip 1 es_menu 0 event_var(attacker) "You have leveled up!\n \n->1. Press 1 to get your next weapon.\n \n0. Exit" } } } else do { // Disable auto_give menu function for victim es_keysetvalue gg_players event_var(userid) turbo_equip 0 es_xmath p_lvl + 1 es_keysetvalue gg_players event_var(attacker) level server_var(p_lvl) es_keygetvalue gg_auto_give gg_players event_var(attacker) auto_give //re-equips weapons //es_xdoblock gungame3/give_turbo_weapon if (server_var(gg_auto_give) == 1) do { es gg_turbo_equip event_var(attacker) } else do { es_keysetvalue gg_players event_var(attacker) turbo_equip 1 es_menu 0 event_var(attacker) "You have leveled up!\n \n->1. Press 1 to get your next weapon.\n \n0. Exit" } } // Update player name in gg_players database es_keysetvalue gg_players event_var(attacker) name event_var(es_attackername) es_setinfo p_diff server_var(ldr_level) es_math p_diff - server_var(p_lvl) if (server_var(p_lvl) > server_var(ldr_level)) do { es_setinfo ldr_level server_var(p_lvl) es_keygetvalue ldr_name gg_players event_var(attacker) name es_msg #multi #green event_var(es_attackername)#lightgreen is leading on level #green server_var(p_lvl) } if (server_var(p_lvl) == server_var(ldr_level)) do { if (event_var(es_attackername) != server_var(ldr_name)) do { es_msg #multi #green event_var(es_attackername)#lightgreen has tied the leader! } } if (server_var(p_lvl) < server_var(ldr_level)) do { es_tell event_var(attacker) #multi #lightgreen[#greenGunGame#lightgreen] You are now #default server_var(p_diff) #lightgreen levels behind the leader } if (event_var(weapon) != "knife") do { es_cexec event_var(attacker) play server_var(gg_sound_levelup) } } else do { es_xsetinfo gg_star 0 if (server_var(gg_triple_on) == 1) do { es_keygetvalue gg_star gg_players event_var(attacker) triple es_xmath gg_star + 1 } if (server_var(gg_star) == 3) do { es_xmath p_lvl + 1 es_keysetvalue gg_players event_var(attacker) level server_var(p_lvl) es_keysetvalue gg_players event_var(attacker) triple 3 es_emitsound player event_var(attacker) server_var(gg_sound_triple) 1.0 1.0 es_msg #multi #green event_var(es_attackername)#lightgreen triple levelled!!! es_centermsg event_var(es_attackername) triple levelled!!! // Effects // Spark effect on player es_give event_var(attacker) env_spark es_fire event_var(attacker) env_spark setparent !activator es_fire event_var(attacker) env_spark addoutput "spawnflags 896" es_fire event_var(attacker) env_spark addoutput "angles -90 0 0" es_fire event_var(attacker) env_spark addoutput "magnitude 8" es_fire event_var(attacker) env_spark addoutput "traillength 3" es_fire event_var(attacker) env_spark startspark // Lighting effect on player es_give event_var(attacker) point_spotlight es_fire event_var(attacker) point_spotlight setparent !activator es_fire event_var(attacker) point_spotlight addoutput "renderamt 255" es_fire event_var(attacker) point_spotlight addoutput "spotlightlength 100" es_fire event_var(attacker) point_spotlight addoutput "spotlightwidth 300" es_fire event_var(attacker) point_spotlight addoutput "rendercolor 0 0 255" es_fire event_var(attacker) point_spotlight addoutput "angles -90 0 0" es_fire event_var(attacker) point_spotlight lighton // Change player speed to 1.5x normal es_setplayerprop event_var(attacker) CCSPlayer.baseclass.localdata.m_flLaggedMovementValue 1.5 // Log triple level for hlstats users es_xcopy oldescape eventscripts_escapechars if (event_var(es_attackerteam) == 2) then es_xsetinfo _tmp "TERRORIST" if (event_var(es_attackerteam) == 3) then es_xsetinfo _tmp "CT" es_format _tmp2 "%1<%2><%3><%4>" event_var(es_attackername) event_var(attacker) event_var(es_attackersteamid) server_var(_tmp) es_xsetinfo eventscripts_escapechars "; {}()':l" es_logq server_var(_tmp2) triggered gg_triplelevel es_xcopy eventscripts_escapechars oldescape // Remove triple level effects in 10 seconds es_delayed 10 gg_triple_cmd event_var(attacker) } else do { if (server_var(gg_star) < server_var(gg_max_lvl)) do { es_keysetvalue gg_players event_var(attacker) triple server_var(gg_star) es_xmath p_lvl + 1 es_keysetvalue gg_players event_var(attacker) level server_var(p_lvl) es_keygetvalue p_wpn gg_weapons server_var(p_lvl) weapon es_fire event_var(attacker) env_hudhint kill es_give event_var(attacker) env_hudhint es_format tmp_menumsg "message You are now on level %1 (%2)" server_var(p_lvl) server_var(p_wpn) es_fire event_var(attacker) env_hudhint AddOutput server_var(tmp_menumsg) es_fire event_var(attacker) env_hudhint ShowHudHint // Update player name in gg_players database es_keysetvalue gg_players event_var(attacker) name event_var(es_attackername) es_setinfo p_diff server_var(ldr_level) es_math p_diff - server_var(p_lvl) if (server_var(p_lvl) > server_var(ldr_level)) do { es_setinfo ldr_level server_var(p_lvl) es_keygetvalue ldr_name gg_players event_var(attacker) name es_msg #multi #green event_var(es_attackername)#lightgreen is leading on level #green server_var(p_lvl) } if (server_var(p_lvl) == server_var(ldr_level)) do { if (event_var(es_attackername) != server_var(ldr_name)) do { es_msg #multi #green event_var(es_attackername)#lightgreen has tied the leader! } } if (server_var(p_lvl) < server_var(ldr_level)) do { es_tell event_var(attacker) #multi #lightgreen[#greenGunGame#lightgreen] You are now #default server_var(p_diff) #lightgreen levels behind the leader } } if (server_var(gg_max_lvl) == 0) do { es_keysetvalue gg_players event_var(attacker) triple server_var(gg_star) es_xmath p_lvl + 1 es_keysetvalue gg_players event_var(attacker) level server_var(p_lvl) es_keygetvalue p_wpn gg_weapons server_var(p_lvl) weapon es_fire event_var(attacker) env_hudhint kill es_give event_var(attacker) env_hudhint es_format tmp_menumsg "message You are now on level %1 (%2)" server_var(p_lvl) server_var(p_wpn) es_fire event_var(attacker) env_hudhint AddOutput server_var(tmp_menumsg) es_fire event_var(attacker) env_hudhint ShowHudHint // Update player name in gg_players database es_keysetvalue gg_players event_var(attacker) name event_var(es_attackername) es_setinfo p_diff server_var(ldr_level) es_math p_diff - server_var(p_lvl) if (server_var(p_lvl) > server_var(ldr_level)) do { es_setinfo ldr_level server_var(p_lvl) es_keygetvalue ldr_name gg_players event_var(attacker) name es_msg #multi #green event_var(es_attackername)#lightgreen is leading on level #green server_var(p_lvl) } if (server_var(p_lvl) == server_var(ldr_level)) do { if (event_var(es_attackername) != server_var(ldr_name)) do { es_msg #multi #green event_var(es_attackername)#lightgreen has tied the leader! } } if (server_var(p_lvl) < server_var(ldr_level)) do { es_tell event_var(attacker) #multi #lightgreen[#greenGunGame#lightgreen] You are now #default server_var(p_diff) #lightgreen levels behind the leader } } if (event_var(weapon) != "knife") do { es_cexec event_var(attacker) play server_var(gg_sound_levelup) } } } // Start a map vote if this is set in the cfg if (server_var(gg_vote) == 1) do { if (server_var(p_lvl) == server_var(gg_level_dynamic)) do { ma_voterandom end 4 es_xsetinfo gg_vote 0 } } if (server_var(gg_vote) == 2) do { if (server_var(p_lvl) == server_var(gg_level_dynamic)) do { es_xdoblock gungame3/gg_voting/map_vote es_xsetinfo gg_vote 0 } } } } block gg_triple_finish { es_xsetinfo _tmp 0 es_xgetargv _tmp 1 // Reset player to defaults es_fire server_var(_tmp) env_spark kill es_fire server_var(_tmp) point_spotlight kill es_setplayerprop server_var(_tmp) CCSPlayer.baseclass.localdata.m_flLaggedMovementValue 1.0 } block gg_suicide { if (server_var(p_lvl) > 1) do { es_xmath p_lvl - 1 es_keysetvalue gg_players event_var(attacker) level server_var(p_lvl) // Log level down for hlstats users es_xcopy oldescape eventscripts_escapechars if (event_var(es_attackerteam) == 2) then es_xsetinfo _tmp "TERRORIST" if (event_var(es_attackerteam) == 3) then es_xsetinfo _tmp "CT" es_format _tmp2 "%1<%2><%3><%4>" event_var(es_attackername) event_var(attacker) event_var(es_attackersteamid) server_var(_tmp) es_xsetinfo eventscripts_escapechars "; {}()':l" es_logq server_var(_tmp2) triggered gg_leveldown es_xcopy eventscripts_escapechars oldescape } es_keysetvalue gg_players event_var(userid) kills 0 es_msg #multi #green event_var(es_attackername)#lightgreen lost a level for committing suicide es_cexec event_var(attacker) play server_var(gg_sound_leveldown) } block gg_worldspawn { if (server_var(victim_lvl) > 1) do { es_xmath victim_lvl - 1 es_keysetvalue gg_players event_var(userid) level server_var(victim_lvl) // Log level down for hlstats users es_xcopy oldescape eventscripts_escapechars if (event_var(es_userteam) == 2) then es_xsetinfo _tmp "TERRORIST" if (event_var(es_userteam) == 3) then es_xsetinfo _tmp "CT" es_format _tmp2 "%1<%2><%3><%4>" event_var(es_username) event_var(userid) event_var(es_steamid) server_var(_tmp) es_xsetinfo eventscripts_escapechars "; {}()':l" es_logq server_var(_tmp2) triggered gg_leveldown es_xcopy eventscripts_escapechars oldescape } es_keysetvalue gg_players event_var(userid) kills 0 es_msg #multi #green event_var(es_username)#lightgreen lost a level for committing suicide es_cexec event_var(userid) play server_var(gg_sound_leveldown) } event player_say { if (event_var(text) == "!rules") then es_xdoblock gungame3/gg_display_rules if (event_var(text) == "!weapons") do { es popup send WeaponPage1 event_var(userid) } if (event_var(text) == "!top5") do { es_tell event_var(userid) #multi Top5 has been upgraded to Top10. Try #green!top10#default instead. } if (event_var(text) == "!top10") do { es popup send Top10Page1 event_var(userid) } if (event_var(text) == "!score") do { es popup send ScorePage1 event_var(userid) } if (event_var(text) == "!level") then es_xdoblock gungame3/gg_display_level if (event_var(text) == "!auto") do { es uniqueid p_steamid event_var(es_steamid) 1 es_keygetvalue gg_auto_give gg_pref server_var(p_steamid) auto_give if (server_var(gg_auto_give) == 0) do { es_keysetvalue gg_pref server_var(p_steamid) auto_give 1 es_keysetvalue gg_players event_var(userid) auto_give 1 es_tell event_var(userid) #multi #lightgreen Auto Give #default On } else do { es_keysetvalue gg_pref server_var(p_steamid) auto_give 0 es_keysetvalue gg_players event_var(userid) auto_give 0 es_tell event_var(userid) #multi #lightgreen Auto Give #default Off } } } event player_disconnect { if (event_var(es_steamid) != "BOT") do { // add player to lvl_db minus one level for punishment es_xsetinfo p_lvl 0 es_keygetvalue p_lvl gg_players event_var(userid) level es_xmath p_lvl - 1 if (server_var(p_lvl) < 2) do { es_xsetinfo p_lvl 1 } es_keygetvalue p_steamid gg_players event_var(userid) steamid es_keycreate lvl_db server_var(p_steamid) es_keysetvalue lvl_db server_var(p_steamid) level server_var(p_lvl) // Delete player from afk_db es_keydelete afk_db event_var(userid) } // Delete player from gg_players es_keydelete gg_players event_var(userid) } event bomb_defused { if (server_var(bomb_defuse_lvl) == 1) do { es_xsetinfo p_lvl 0 es_keygetvalue p_lvl gg_players event_var(userid) level es_xsetinfo p_wpn 0 es_keygetvalue p_wpn gg_weapons server_var(p_lvl) weapon if (server_var(p_wpn) != "hegrenade") do { if (server_var(p_wpn) != "knife") do { if (server_var(p_lvl) != server_var(gg_levels)) do { es_xmath p_lvl + 1 es_keysetvalue gg_players event_var(userid) level server_var(p_lvl) es_msg #green event_var(es_username) gained a level for defusing es_cexec event_var(userid) play server_var(gg_sound_levelup) // Reset kill totals es_keysetvalue gg_players event_var(userid) kills 0 // Log level up for hlstats users es_xsetinfo _tmp 0 es_xsetinfo _tmp2 0 es_xsetinfo oldescape 0 es_xcopy oldescape eventscripts_escapechars if (event_var(es_userteam) == 2) then es_xsetinfo _tmp "TERRORIST" if (event_var(es_userteam) == 3) then es_xsetinfo _tmp "CT" es_format _tmp2 "%1<%2><%3><%4>" event_var(es_username) event_var(userid) event_var(es_steamid) server_var(_tmp) es_xsetinfo eventscripts_escapechars "; {}()':l" es_logq server_var(_tmp2) triggered gg_levelup es_xcopy eventscripts_escapechars oldescape } else do { es_tell event_var(userid) #green You cannot skip level server_var(p_lvl) by defusing! } } else do { es_tell event_var(userid) #green You cannot skip level server_var(p_lvl) by defusing! } } else do { es_tell event_var(userid) #green You cannot skip level server_var(p_lvl) by defusing! } } } event bomb_exploded { if (server_var(bomb_defuse_lvl) == 1) do { es_xsetinfo p_lvl 0 es_keygetvalue p_lvl gg_players event_var(userid) level es_xsetinfo p_wpn 0 es_keygetvalue p_wpn gg_weapons server_var(p_lvl) weapon if (server_var(p_wpn) != "hegrenade") do { if (server_var(p_wpn) != "knife") do { if (server_var(p_lvl) != server_var(gg_levels)) do { es_xmath p_lvl + 1 es_keysetvalue gg_players event_var(userid) level server_var(p_lvl) es_msg #green event_var(es_username) gained a level for planting the bomb es_cexec event_var(userid) play server_var(gg_sound_levelup) // Reset kill totals es_keysetvalue gg_players event_var(userid) kills 0 // Log level up for hlstats users es_xsetinfo _tmp 0 es_xsetinfo _tmp2 0 es_xsetinfo oldescape 0 es_xcopy oldescape eventscripts_escapechars if (event_var(es_userteam) == 2) then es_xsetinfo _tmp "TERRORIST" if (event_var(es_userteam) == 3) then es_xsetinfo _tmp "CT" es_format _tmp2 "%1<%2><%3><%4>" event_var(es_username) event_var(userid) event_var(es_steamid) server_var(_tmp) es_xsetinfo eventscripts_escapechars "; {}()':l" es_logq server_var(_tmp2) triggered gg_levelup es_xcopy eventscripts_escapechars oldescape } else do { es_tell event_var(userid) #green You cannot skip level server_var(p_lvl) by planting the bomb! } } else do { es_tell event_var(userid) #green You cannot skip level server_var(p_lvl) by planting the bomb! } } else do { es_tell event_var(userid) #green You cannot skip level server_var(p_lvl) by planting the bomb! } } } event round_start { // End suicide protection given at round_end es_xsetinfo suicide_protect 0 // Get mp_friendlyfire settings es_xsetinfo ldr_weapon 0 es_keygetvalue ldr_weapon gg_weapons server_var(ldr_level) weapon if (server_var(ldr_weapon) == "hegrenade") do { es_cexec_all play server_var(gg_sound_nade) if (server_var(gg_ff_auto) == 1) do { if (server_var(mp_friendlyfire) == 0) do { mp_friendlyfire 1 es_xmsg #green Friendly Fire is ON!!! Watch your fire! } } } if (server_var(ldr_weapon) == "knife") do { es_cexec_all play server_var(gg_sound_knife) } // Reset triple level counts if (server_var(gg_triple_on) == 1) do { alias gg_reset_triple "es_keysetvalue gg_players server_var(tmp) triple 0" es_xforeachkey tmp in gg_players gg_reset_triple } // Get random player and remove objectives if (server_var(gg_obj_remove) == 1) do { getrandplayer _tmp #all es_fire server_var(_tmp) func_bomb_target Disable es_fire server_var(_tmp) func_hostage_rescue Disable es_fire server_var(_tmp) weapon_c4 Kill es_fire server_var(_tmp) hostage_entity Kill } else do { // Give taken c4 back to Terrorist es_delayed 2 es_xgive server_var(bomber) weapon_c4 } } event round_end { // Give suicide protection for team changes at round end es_xsetinfo suicide_protect 1 // Get leader information alias gg_chk_ldr "es_keygetvalue ldr_a gg_players server_var(p_id) level; if (server_var(ldr_a) > server_var(ldr_level)) then es_xkeygetvalue ldr_name gg_players server_var(p_id) name; if (server_var(ldr_a) > server_var(ldr_level)) then es_xsetinfo ldr_level server_var(ldr_a)" es_xsetinfo ldr_a 0 es_xsetinfo ldr_level 0 es_xsetinfo ldr_name "none" es_xdelayed 1 es_xforeachkey p_id in gg_players gg_chk_ldr // Reset bomber if (server_var(gg_obj_remove) != 1) do { foreach player bomb_userid #all "es_fire server_var(bomb_userid) weapon_c4 kill" es_xsetinfo bomber 0 } // Reset round levelup es_xforeachkey _player in gg_players "es_keysetvalue gg_players server_var(_player) levelup 0" } event item_pickup { if (server_var(suicide_protect) == 1) do { if (event_var(item) == "c4") do { es_fire event_var(userid) weapon_c4 kill } } if (server_var(gg_dm_script) == 1) do { if (event_var(item) == "c4") do { es_fire event_var(userid) weapon_c4 kill } } if (server_var(gg_knife_elite) == 1) do { es_xsetinfo p_item 0 es_xsetinfo p_levelup 0 es_keygetvalue p_levelup gg_players event_var(userid) levelup if (server_var(p_levelup) == 1) do { if (event_var(item) != "knife") do { if (event_var(item) != "c4") do { es_give event_var(userid) player_weaponstrip es_fire event_var(userid) player_weaponstrip Strip 1 es_delayed .3 es_xgive event_var(userid) weapon_knife if (server_var(bomber) = event_var(userid)) then es_xdelayed .5 es_xgive event_var(userid) weapon_c4 } } } } } event weapon_fire { // Change player's location in afk_db to avoid exploit //if (event_var(es_steamid) != "BOT") do //{ es_keysetvalue afk_db event_var(userid) x 1 //es_keysetvalue afk_db event_var(userid) y 1 //} } block gg_winner { es_xsetinfo t_wins 0 // Open gg_winners db if (server_var(win_db_open) == 0) do { es_xexists gg_exists keygroup gg_winners if (server_var(gg_exists) == 1) then es_xkeygroupdelete gg_winners es_xkeygroupcreate gg_winners es_keygroupload gg_winners server_var(gg_dir) es_xsetinfo win_db_open 1 } es_xmath gg_read_write + 1 // Save player win total if (server_var(sv_lan) == 1) do { es_keygetvalue t_wins gg_winners event_var(es_attackername) wins if (server_var(t_wins) == 0) do { es_keycreate gg_winners event_var(es_attackername) } es_xmath t_wins + 1 es_keysetvalue gg_winners event_var(es_attackername) name event_var(es_attackername) es_keysetvalue gg_winners event_var(es_attackername) wins server_var(t_wins) } else do { es uniqueid p_steamid event_var(es_attackersteamid) 1 es_keygetvalue t_wins gg_winners server_var(p_steamid) wins if (server_var(t_wins) == 0) do { es_keycreate gg_winners server_var(p_steamid) } es_xmath t_wins + 1 es_keysetvalue gg_winners server_var(p_steamid) name event_var(es_attackername) es_keysetvalue gg_winners server_var(p_steamid) wins server_var(t_wins) } es_keysetvalue gg_players event_var(attacker) wins server_var(t_wins) // Save and close gg_winners es_xmath gg_read_write - 1 if (server_var(gg_read_write) == 0) do { if (server_var(win_db_open) == 1) do { es_keygroupsave gg_winners server_var(gg_dir) es_xkeygroupdelete gg_winners es_xsetinfo win_db_open 0 } } // Update top10 db es_xsetinfo top10_list 0 es_xkeygetvalue top10_list gg_top10 10 wins if (server_var(t_wins) >= server_var(top10_list)) then es_xdoblock gungame3/gg_execute_top10 // Save gg_pref db es_keygroupsave gg_pref server_var(gg_dir) } block endround { sv_cheats 1 endround sv_cheats 0 } block winner_reset { alias gg_winner_reset "es_keysetvalue gg_players server_var(test) level 1" es_xforeachkey test in gg_players gg_winner_reset es_xsetinfo ldr_level 1 es_xsetinfo gg_one_winner 0 } block gg_handicap { // Execute averaging code es_xsetinfo tmp_total 0.0 es_xsetinfo tmp_count 0 es_xsetinfo tmp_stor 0 alias get_totals "es_keygetvalue tmp_stor gg_players server_var(avg_key) level; es_math tmp_total + server_var(tmp_stor); es_xmath tmp_count + 1" es_xforeachkey avg_key in gg_players get_totals es_math tmp_total / server_var(tmp_count) es_token tmp_total server_var(tmp_total) 1 . if (server_var(tmp_total) > 1) do { if (server_var(gg_top10_handicap) == 1) do { es_keysetvalue gg_players event_var(userid) level server_var(tmp_total) } else do { es_xsetinfo p_1337 0 es_xsetinfo tmp_1337 0 alias get_1337_steam "es uniqueid p_steamid event_var(es_steamid) 1; es_keygetvalue tmp_1337 gg_top10 server_var(plyr_1337) steam; if (server_var(p_steamid) == server_var(tmp_1337)) then es_xsetinfo p_1337 1" es_xforeachkey plyr_1337 in gg_top10 get_1337_steam if (server_var(p_1337) == 0) do { es_keysetvalue gg_players event_var(userid) level server_var(tmp_total) } } } } block gg_handicap_in_progress { // Execute averaging code es_xsetinfo tmp_total 0.0 es_xsetinfo tmp_count 0 es_xsetinfo tmp_stor 0 alias get_totals_np "es_keygetvalue tmp_stor gg_players server_var(avg_key) level; es_math tmp_total + server_var(tmp_stor); es_xmath tmp_count + 1" es_xforeachkey avg_key in gg_players get_totals_np es_math tmp_total / server_var(tmp_count) es_token tmp_total server_var(tmp_total) 1 . if (server_var(tmp_total) > 1) do { if (server_var(gg_top10_handicap) == 1) do { if (server_var(sv_lan) == 1) do { es_keysetvalue gg_players server_var(gg_tmp_n) level server_var(tmp_total) } else do { es_keysetvalue gg_players server_var(gg_tmp_s) level server_var(tmp_total) } } else do { es_xsetinfo p_1337 0 es_xsetinfo tmp_1337 0 alias get_1337_steam_np "es_keygetvalue tmp_1337 gg_top10 server_var(plyr_1337) steam; if (server_var(gg_tmp_s) == server_var(tmp_1337)) then es_xsetinfo p_1337 1" es_xforeachkey plyr_1337 in gg_top10 get_1337_steam_np if (server_var(p_1337) == 0) do { es_keysetvalue gg_players server_var(key_x) level server_var(tmp_total) } } } } block bot_spawn { // Level variables es_xsetinfo p_lvl 0 es_xsetinfo p_wpn 0 es_xsetinfo p_kills 0 // Get player's level and weapon from db es_keygetvalue p_lvl gg_players event_var(userid) level if (server_var(p_lvl) == 0) do { es_keysetvalue gg_players event_var(userid) level 1 } es_keygetvalue p_wpn gg_weapons server_var(p_lvl) weapon // Equip player es_format p_wpn "weapon_%1" server_var(p_wpn) es_delayed .5 es_xgive event_var(userid) server_var(p_wpn) es_delayed .5 es_xgive event_var(userid) item_assaultsuit if (server_var(p_wpn) != "weapon_knife") then es_xdelayed .5 es_xgive event_var(userid) weapon_knife if (server_var(p_wpn) == "weapon_hegrenade") do { if (server_var(gg_nade_glock) == 1) do { es_delayed .5 es_xgive event_var(userid) weapon_glock } if (server_var(gg_nade_flash) == 1) do { es_delayed .5 es_xgive event_var(userid) weapon_flashbang } if (server_var(gg_nade_smoke) == 1) do { es_delayed .5 es_xgive event_var(userid) weapon_smokegrenade } } // Give each CT a defuse kit if (server_var(gg_dm_script) != 1) do { if (event_var(es_userteam) == 3) do { es_setplayerprop event_var(userid) CCSPlayer.m_bHasDefuser 1 } } } block gg_execute_top10 { es_xsetinfo reserve_name 0 es_xsetinfo reserve_steam 0 es_xsetinfo reserve_wins 0 es_xsetinfo top1_steam 0 es_xsetinfo top2_steam 0 es_xsetinfo top3_steam 0 es_xsetinfo top4_steam 0 es_xsetinfo top5_steam 0 es_xsetinfo top6_steam 0 es_xsetinfo top7_steam 0 es_xsetinfo top8_steam 0 es_xsetinfo top9_steam 0 es_xsetinfo top10_steam 0 es_xsetinfo top1_wins 0 es_xsetinfo top2_wins 0 es_xsetinfo top3_wins 0 es_xsetinfo top4_wins 0 es_xsetinfo top5_wins 0 es_xsetinfo top6_wins 0 es_xsetinfo top7_wins 0 es_xsetinfo top8_wins 0 es_xsetinfo top9_wins 0 es_xsetinfo top10_wins 0 es_xkeygetvalue top1_steam gg_top10 1 steam es_xkeygetvalue top2_steam gg_top10 2 steam es_xkeygetvalue top3_steam gg_top10 3 steam es_xkeygetvalue top4_steam gg_top10 4 steam es_xkeygetvalue top5_steam gg_top10 5 steam es_xkeygetvalue top6_steam gg_top10 6 steam es_xkeygetvalue top7_steam gg_top10 7 steam es_xkeygetvalue top8_steam gg_top10 8 steam es_xkeygetvalue top9_steam gg_top10 9 steam es_xkeygetvalue top10_steam gg_top10 10 steam es_xkeygetvalue top1_wins gg_top10 1 wins es_xkeygetvalue top2_wins gg_top10 2 wins es_xkeygetvalue top3_wins gg_top10 3 wins es_xkeygetvalue top4_wins gg_top10 4 wins es_xkeygetvalue top5_wins gg_top10 5 wins es_xkeygetvalue top6_wins gg_top10 6 wins es_xkeygetvalue top7_wins gg_top10 7 wins es_xkeygetvalue top8_wins gg_top10 8 wins es_xkeygetvalue top9_wins gg_top10 9 wins es_xkeygetvalue top10_wins gg_top10 10 wins // Winner name is server_var(winner_name) // Winner steamid is server_var(winner_steam) // Winner win amount is server_var(t_wins) alias move_top1 "es_xkeygetvalue reserve_name gg_top10 1 name; es_xkeygetvalue reserve_steam gg_top10 1 steam; es_xkeygetvalue reserve_wins gg_top10 1 wins; es_keysetvalue gg_top10 2 name server_var(reserve_name); es_keysetvalue gg_top10 2 steam server_var(reserve_steam); es_keysetvalue gg_top10 2 wins server_var(reserve_wins); write_top1" alias move_top2 "es_xkeygetvalue reserve_name gg_top10 2 name; es_xkeygetvalue reserve_steam gg_top10 2 steam; es_xkeygetvalue reserve_wins gg_top10 2 wins; es_keysetvalue gg_top10 3 name server_var(reserve_name); es_keysetvalue gg_top10 3 steam server_var(reserve_steam); es_keysetvalue gg_top10 3 wins server_var(reserve_wins); overwrite2" alias move_top3 "es_xkeygetvalue reserve_name gg_top10 3 name; es_xkeygetvalue reserve_steam gg_top10 3 steam; es_xkeygetvalue reserve_wins gg_top10 3 wins; es_keysetvalue gg_top10 4 name server_var(reserve_name); es_keysetvalue gg_top10 4 steam server_var(reserve_steam); es_keysetvalue gg_top10 4 wins server_var(reserve_wins); overwrite3" alias move_top4 "es_xkeygetvalue reserve_name gg_top10 4 name; es_xkeygetvalue reserve_steam gg_top10 4 steam; es_xkeygetvalue reserve_wins gg_top10 4 wins; es_keysetvalue gg_top10 5 name server_var(reserve_name); es_keysetvalue gg_top10 5 steam server_var(reserve_steam); es_keysetvalue gg_top10 5 wins server_var(reserve_wins); overwrite4" alias move_top5 "es_xkeygetvalue reserve_name gg_top10 5 name; es_xkeygetvalue reserve_steam gg_top10 5 steam; es_xkeygetvalue reserve_wins gg_top10 5 wins; es_keysetvalue gg_top10 6 name server_var(reserve_name); es_keysetvalue gg_top10 6 steam server_var(reserve_steam); es_keysetvalue gg_top10 6 wins server_var(reserve_wins); overwrite5" alias move_top6 "es_xkeygetvalue reserve_name gg_top10 6 name; es_xkeygetvalue reserve_steam gg_top10 6 steam; es_xkeygetvalue reserve_wins gg_top10 6 wins; es_keysetvalue gg_top10 7 name server_var(reserve_name); es_keysetvalue gg_top10 7 steam server_var(reserve_steam); es_keysetvalue gg_top10 7 wins server_var(reserve_wins); overwrite6" alias move_top7 "es_xkeygetvalue reserve_name gg_top10 7 name; es_xkeygetvalue reserve_steam gg_top10 7 steam; es_xkeygetvalue reserve_wins gg_top10 7 wins; es_keysetvalue gg_top10 8 name server_var(reserve_name); es_keysetvalue gg_top10 8 steam server_var(reserve_steam); es_keysetvalue gg_top10 8 wins server_var(reserve_wins); overwrite7" alias move_top8 "es_xkeygetvalue reserve_name gg_top10 8 name; es_xkeygetvalue reserve_steam gg_top10 8 steam; es_xkeygetvalue reserve_wins gg_top10 8 wins; es_keysetvalue gg_top10 9 name server_var(reserve_name); es_keysetvalue gg_top10 9 steam server_var(reserve_steam); es_keysetvalue gg_top10 9 wins server_var(reserve_wins); overwrite8" alias move_top9 "es_xkeygetvalue reserve_name gg_top10 9 name; es_xkeygetvalue reserve_steam gg_top10 9 steam; es_xkeygetvalue reserve_wins gg_top10 9 wins; es_keysetvalue gg_top10 10 name server_var(reserve_name); es_keysetvalue gg_top10 10 steam server_var(reserve_steam); es_keysetvalue gg_top10 10 wins server_var(reserve_wins); overwrite9" alias overwrite2 "es_keysetvalue gg_top10 2 name server_var(winner_name); es_keysetvalue gg_top10 2 steam server_var(winner_steam); es_keysetvalue gg_top10 2 wins server_var(t_wins)" alias overwrite3 "es_keysetvalue gg_top10 3 name server_var(winner_name); es_keysetvalue gg_top10 3 steam server_var(winner_steam); es_keysetvalue gg_top10 3 wins server_var(t_wins)" alias overwrite4 "es_keysetvalue gg_top10 4 name server_var(winner_name); es_keysetvalue gg_top10 4 steam server_var(winner_steam); es_keysetvalue gg_top10 4 wins server_var(t_wins)" alias overwrite5 "es_keysetvalue gg_top10 5 name server_var(winner_name); es_keysetvalue gg_top10 5 steam server_var(winner_steam); es_keysetvalue gg_top10 5 wins server_var(t_wins)" alias overwrite6 "es_keysetvalue gg_top10 6 name server_var(winner_name); es_keysetvalue gg_top10 6 steam server_var(winner_steam); es_keysetvalue gg_top10 6 wins server_var(t_wins)" alias overwrite7 "es_keysetvalue gg_top10 7 name server_var(winner_name); es_keysetvalue gg_top10 7 steam server_var(winner_steam); es_keysetvalue gg_top10 7 wins server_var(t_wins)" alias overwrite8 "es_keysetvalue gg_top10 8 name server_var(winner_name); es_keysetvalue gg_top10 8 steam server_var(winner_steam); es_keysetvalue gg_top10 8 wins server_var(t_wins)" alias overwrite9 "es_keysetvalue gg_top10 9 name server_var(winner_name); es_keysetvalue gg_top10 9 steam server_var(winner_steam); es_keysetvalue gg_top10 9 wins server_var(t_wins)" alias overwrite10 "es_keysetvalue gg_top10 10 name server_var(winner_name); es_keysetvalue gg_top10 10 steam server_var(winner_steam); es_keysetvalue gg_top10 10 wins server_var(t_wins)" alias write_top1 "es_keysetvalue gg_top10 1 name server_var(winner_name); es_keysetvalue gg_top10 1 steam server_var(winner_steam); es_keysetvalue gg_top10 1 wins server_var(t_wins)" alias write_top2 "if (server_var(t_wins) > server_var(top1_wins)) then move_top1; if (server_var(t_wins) <= server_var(top1_wins)) then overwrite2" alias write_top3 "if (server_var(t_wins) > server_var(top2_wins)) then move_top2; if (server_var(t_wins) <= server_var(top2_wins)) then overwrite3" alias write_top4 "if (server_var(t_wins) > server_var(top3_wins)) then move_top3; if (server_var(t_wins) <= server_var(top3_wins)) then overwrite4" alias write_top5 "if (server_var(t_wins) > server_var(top4_wins)) then move_top4; if (server_var(t_wins) <= server_var(top4_wins)) then overwrite5" alias write_top6 "if (server_var(t_wins) > server_var(top5_wins)) then move_top5; if (server_var(t_wins) <= server_var(top5_wins)) then overwrite6" alias write_top7 "if (server_var(t_wins) > server_var(top6_wins)) then move_top6; if (server_var(t_wins) <= server_var(top6_wins)) then overwrite7" alias write_top8 "if (server_var(t_wins) > server_var(top7_wins)) then move_top7; if (server_var(t_wins) <= server_var(top7_wins)) then overwrite8" alias write_top9 "if (server_var(t_wins) > server_var(top8_wins)) then move_top8; if (server_var(t_wins) <= server_var(top8_wins)) then overwrite9" alias write_top10 "if (server_var(t_wins) > server_var(top9_wins)) then move_top9; if (server_var(t_wins) <= server_var(top9_wins)) then overwrite10" if (server_var(top1_steam) == 0) do { write_top1 } else do { if (server_var(winner_steam) == server_var(top1_steam)) do { write_top1 } else do { if (server_var(winner_steam) == server_var(top2_steam)) do { write_top2 } else do { if (server_var(winner_steam) == server_var(top3_steam)) do { write_top3 } else do { if (server_var(winner_steam) == server_var(top4_steam)) do { write_top4 } else do { if (server_var(winner_steam) == server_var(top5_steam)) do { write_top5 } else do { if (server_var(winner_steam) == server_var(top6_steam)) do { write_top6 } else do { if (server_var(winner_steam) == server_var(top7_steam)) do { write_top7 } else do { if (server_var(winner_steam) == server_var(top8_steam)) do { write_top8 } else do { if (server_var(winner_steam) == server_var(top9_steam)) do { write_top9 } else do { write_top10 } } } } } } } } } } // Move players in top10 based on win amount es_xkeygetvalue top9_wins gg_top10 9 wins es_xkeygetvalue top10_wins gg_top10 10 wins if (server_var(top10_wins) > server_var(top9_wins)) do { es_xkeygetvalue winner_name gg_top10 10 name es_xkeygetvalue winner_steam gg_top10 10 steam es_xkeygetvalue t_wins gg_top10 10 wins move_top9 } es_xkeygetvalue top8_wins gg_top10 8 wins es_xkeygetvalue top9_wins gg_top10 9 wins if (server_var(top9_wins) > server_var(top8_wins)) do { es_xkeygetvalue winner_name gg_top10 9 name es_xkeygetvalue winner_steam gg_top10 9 steam es_xkeygetvalue t_wins gg_top10 9 wins move_top8 } es_xkeygetvalue top7_wins gg_top10 7 wins es_xkeygetvalue top8_wins gg_top10 8 wins if (server_var(top8_wins) > server_var(top7_wins)) do { es_xkeygetvalue winner_name gg_top10 8 name es_xkeygetvalue winner_steam gg_top10 8 steam es_xkeygetvalue t_wins gg_top10 8 wins move_top7 } es_xkeygetvalue top6_wins gg_top10 6 wins es_xkeygetvalue top7_wins gg_top10 7 wins if (server_var(top7_wins) > server_var(top6_wins)) do { es_xkeygetvalue winner_name gg_top10 7 name es_xkeygetvalue winner_steam gg_top10 7 steam es_xkeygetvalue t_wins gg_top10 7 wins move_top6 } es_xkeygetvalue top5_wins gg_top10 5 wins es_xkeygetvalue top6_wins gg_top10 6 wins if (server_var(top6_wins) > server_var(top5_wins)) do { es_xkeygetvalue winner_name gg_top10 6 name es_xkeygetvalue winner_steam gg_top10 6 steam es_xkeygetvalue t_wins gg_top10 6 wins move_top5 } es_xkeygetvalue top4_wins gg_top10 4 wins es_xkeygetvalue top5_wins gg_top10 5 wins if (server_var(top5_wins) > server_var(top4_wins)) do { es_xkeygetvalue winner_name gg_top10 5 name es_xkeygetvalue winner_steam gg_top10 5 steam es_xkeygetvalue t_wins gg_top10 5 wins move_top4 } es_xkeygetvalue top3_wins gg_top10 3 wins es_xkeygetvalue top4_wins gg_top10 4 wins if (server_var(top4_wins) > server_var(top3_wins)) do { es_xkeygetvalue winner_name gg_top10 4 name es_xkeygetvalue winner_steam gg_top10 4 steam es_xkeygetvalue t_wins gg_top10 4 wins move_top3 } es_xkeygetvalue top2_wins gg_top10 2 wins es_xkeygetvalue top3_wins gg_top10 3 wins if (server_var(top3_wins) > server_var(top2_wins)) do { es_xkeygetvalue winner_name gg_top10 3 name es_xkeygetvalue winner_steam gg_top10 3 steam es_xkeygetvalue t_wins gg_top10 3 wins move_top2 } es_xkeygetvalue top1_wins gg_top10 1 wins es_xkeygetvalue top2_wins gg_top10 2 wins if (server_var(top2_wins) > server_var(top1_wins)) do { es_xkeygetvalue winner_name gg_top10 2 name es_xkeygetvalue winner_steam gg_top10 2 steam es_xkeygetvalue t_wins gg_top10 2 wins move_top1 } es_keygroupsave gg_top10 server_var(gg_dir) } block gg_display_rules { es_cexec event_var(userid) echo ----------------------------- es_cexec event_var(userid) echo ----------------------------- es_cexec event_var(userid) echo **** Gun Game Rules: **** es_cexec event_var(userid) echo 1) You must get a kill with your current weapon to level up. es_cexec event_var(userid) echo 2) If you get a kill with a weapon out of order, it does not count and you remain on your current level. es_cexec event_var(userid) echo 3) You can gain levels by PLANTING and DEFUSING. es_cexec event_var(userid) echo 4) If you commit suicide, you will lose a level. es_cexec event_var(userid) echo 5) Friendly Fire is turned ON when someone reaches GRENADE level. es_cexec event_var(userid) echo 6) You CAN gain more than one level per round. es_cexec event_var(userid) echo 7) There is a grace period at the end of each round to allow players to switch teams. es_cexec event_var(userid) echo 8) If Knife Pro is ENABLED, you can steal a level from an opponent by knifing them. es_cexec event_var(userid) echo 9) If GG Turbo is ENABLED, you will receive your next weapon immediately when you level up. es_cexec event_var(userid) echo 10) If Knife Elite is ENABLED, after you levelup, you will only have a knife until the next round starts. es_cexec event_var(userid) echo **************************************************************** es_cexec event_var(userid) echo Say !level to see your current level and who is winning. es_cexec event_var(userid) echo Say !weapons to see the weapon order. es_cexec event_var(userid) echo Say !score to see all player current scores. es_cexec event_var(userid) echo Say !top10 to see the top 10 winners on the server. es_cexec event_var(userid) echo Say !stuck if you get stuck to another player. es_cexec event_var(userid) echo Say !auto to turn Auto Give on/off. es_cexec event_var(userid) echo Say !give if you do not receive your weapon. (Deathmatch ONLY) es_cexec event_var(userid) echo ----------------------------- es_cexec event_var(userid) echo ----------------------------- es_menu 0 event_var(userid) "GunGame rules and chat commands are\nlisted in your game console.\n \nGunGame Chat Commands:\n--------------------------------\n->1. !top10\n - to see the top 10 players on this server\n->2. !level\n - to see your current level and who is winning\n->3. !weapons\n - to see the weapon order\n->4. !score\n - to see player scores\n->5. !stuck\n - will respawn you if you get stuck\n--------------------------------\n \n->0. Exit" } block gg_display_level { es_keygetvalue p_lvl gg_players event_var(userid) level es_keygetvalue p_wpn gg_weapons server_var(p_lvl) weapon es_keygetvalue p_wins gg_players event_var(userid) wins es_keygetvalue p_kills gg_players event_var(userid) kills es_setinfo p_lvlsbehind server_var(ldr_level) es_math p_lvlsbehind - server_var(p_lvl) if (server_var(ldr_level) != 0) do { if (server_var(p_lvlsbehind) = 0) do { if (server_var(ldr_name) = event_var(es_username)) do { es_xformat tmp_leadermsg "You are currently the leader" } else do { if (server_var(ldr_name) != none) do { es_xformat tmp_leadermsg "You are currently tied with the leader" } else do { es_xformat tmp_leadermsg "There currently is no leader" } } } else do { if (server_var(p_lvlsbehind) = 1) do { es_xformat tmp_leadermsg "You are 1 level behind the leader" } else do { es_format tmp_leadermsg "You are %1 levels behind the leader" server_var(p_lvlsbehind) } } } else do { es_xformat tmp_leadermsg "There currently is no leader" } if (server_var(gg_multikill) > 1) do { if (server_var(p_wpn) != "hegrenade") do { if (server_var(p_wpn) != "knife") do { es_format tmp_menumsg "GunGame Level Information:\n \n->1. LEVEL\n---------------------------------\nYou are on level %1 (%2)\nYou have made %3/%4 of your required kills\n%5\n \n->2. WINS\n---------------------------------\nYou have won %6 times\n \n->3. LEADER\n---------------------------------\nCurrent leader:" server_var(p_lvl) server_var(p_wpn) server_var(p_kills) server_var(gg_multikill) server_var(tmp_leadermsg) server_var(p_wins) } } } else do { es_format tmp_menumsg "GunGame Level Information:\n \n->1. LEVEL\n---------------------------------\nYou are on level %1\nYou need a %2 kill to advance\n%3\n \n->2. WINS\n---------------------------------\nYou have won %4 times\n \n->3. LEADER\n---------------------------------\nCurrent leader:" server_var(p_lvl) server_var(p_wpn) server_var(tmp_leadermsg) server_var(p_wins) } if (server_var(ldr_level) > 0) do { es_format tmp_menumsg "%1 %2\nLeader Level: %3" server_var(tmp_menumsg) server_var(ldr_name) server_var(ldr_level) } else do { es_format tmp_menumsg "%1 Calculating..." server_var(tmp_menumsg) } es_menu 5 event_var(userid) server_var(tmp_menumsg) } block unload { // Save gg_pref db es_keygroupsave gg_pref server_var(gg_dir) // Delete all open databases es_xkeygroupdelete gg_players es_xkeygroupdelete gg_pref es_xkeygroupdelete gg_winners es_xkeygroupdelete gg_top10 es_xkeygroupdelete gg_weapons es_xkeygroupdelete lvl_db es_xkeygroupdelete afk_db // Delete popup menus es_xsetinfo tmp_looper 1 es_xdoblock gungame3/unsendScorePage es_xsetinfo tmp_weplooper 1 es_xdoblock gungame3/unsendWeaponPage es_xsetinfo tmp_top10_looper 1 es_xdoblock gungame3/unsendTop10Page // Unload subscripts if (server_var(gg_dm_script) == 1) then es_xunload gungame3/gg_css_dm if (server_var(gg_vote_setting) == 2) then es_xunload gungame3/gg_voting if (server_var(gg_rand_song) == 1) then es_xunload gungame3/gg_songs // Disable eventscripts_noisy if no other scripts need it // Turn eventscripts_noisy off es_xdoblock corelib/noisy_off } block gg_reset_scores { // Delete all open databases es_xkeygroupdelete gg_players es_xkeygroupdelete gg_winners es_xkeygroupdelete gg_top10 es_xkeygroupdelete lvl_db es_xkeygroupdelete afk_db // Create empty database es_xkeygroupcreate gg_winners es_keygroupsave gg_winners server_var(gg_dir) es_xkeygroupcreate gg_top10 es_xsetinfo top10_counter 1 es_xdoblock gungame3/create_top10 // Restart the map es_delayed 7 changelevel server_var(eventscripts_currentmap) es_xmsg #green Gun Game scores have been reset! es_xmsg #green Game will restart in 7 seconds... } event es_client_command { if (event_var(command) == "!rules") then es_xdoblock gungame3/gg_display_rules if (event_var(command) == "!weapons") do { es popup send WeaponPage1 event_var(userid) } if (event_var(command) == "!top5") do { es_tell event_var(userid) #multi Top5 has been upgraded to Top10. Try #green!top10#default instead. } if (event_var(command) == "!top10") do { es popup send Top10Page1 event_var(userid) } if (event_var(command) == "!score") then es popup send ScorePage1 event_var(userid) if (event_var(command) == "!level") then es_xdoblock gungame3/gg_display_level if (event_var(command) == "!auto") do { es uniqueid p_steamid event_var(es_steamid) 1 es_keygetvalue gg_auto_give gg_pref server_var(p_steamid) auto_give if (server_var(gg_auto_give) == 0) do { es_keysetvalue gg_pref server_var(p_steamid) auto_give 1 es_keysetvalue gg_players event_var(userid) auto_give 1 es_tell event_var(userid) #multi #lightgreen Auto Give #default On } else do { es_keysetvalue gg_pref server_var(p_steamid) auto_give 0 es_keysetvalue gg_players event_var(userid) auto_give 0 es_tell event_var(userid) #multi #lightgreen Auto Give #default Off } } if (event_var(command) == "menuselect") do { if (event_var(commandstring) >= 0) do { es_keygetvalue gg_equip gg_players event_var(userid) turbo_equip if (server_var(gg_equip) == 1) do { es_keysetvalue gg_players event_var(userid) turbo_equip 0 es gg_turbo_equip event_var(userid) } } } } block give_player_weapon { // Level variables es_xsetinfo p_lvl 0 es_xsetinfo p_wpn 0 es_xsetinfo p_kills 0 // Get player's level and weapon from db es_keygetvalue p_lvl gg_players server_var(user_id) level if (server_var(p_lvl) == 0) do { es_keysetvalue gg_players server_var(user_id) level 1 } es_keygetvalue p_wpn gg_weapons server_var(p_lvl) weapon // Equip player es_format p_wpn "weapon_%1" server_var(p_wpn) if (server_var(p_wpn) != "weapon_knife") then es_xgive server_var(user_id) weapon_knife es_give server_var(user_id) item_assaultsuit es_give server_var(user_id) server_var(p_wpn) if (server_var(p_wpn) == "weapon_hegrenade") do { if (server_var(gg_nade_glock) == 1) do { es_give server_var(user_id) weapon_glock es_setplayerprop server_var(user_id) CCSPlayer.baseclass.localdata.m_iAmmo.006 50 } if (server_var(gg_nade_flash) == 1) do { es_give server_var(user_id) weapon_flashbang } if (server_var(gg_nade_smoke) == 1) do { es_give server_var(user_id) weapon_smokegrenade } } // Give each CT a defuse kit if (server_var(gg_dm_script) != 1) do { es_getplayerteam gg_tmp server_var(user_id) if (server_var(gg_tmp) == 3) do { es_setplayerprop server_var(user_id) CCSPlayer.m_bHasDefuser 1 } } // give them the right ammo for their gun //es_keygetvalue gg_ammoname gg_ammo_props server_var(p_wpn) //es_keygetvalue gg_ammonum gg_ammo_count server_var(p_wpn) //es_setplayerprop server_var(user_id) server_var(gg_ammoname) server_var(gg_ammonum) } block give_warmup_knife { // Round start message es_tell server_var(user_id) #multi #lightgreen[#greenGunGame#lightgreen] Warmup round -- KNIVES ONLY es_give server_var(user_id) item_assaultsuit es_give server_var(user_id) weapon_knife } block give_turbo_weapon { // Get player userid es_xsetinfo _tmp3 0 es_xgetargv _tmp3 1 // Strip weapons from player es_give server_var(_tmp3) player_weaponstrip es_fire server_var(_tmp3) player_weaponstrip Strip 1 if (server_var(bomber) == server_var(_tmp3)) then es_xdelayed 1 es_xgive server_var(_tmp3) weapon_c4 // Level variables es_xsetinfo p_lvl 0 es_xsetinfo p_wpn 0 // Get player's level and weapon from db es_keygetvalue p_lvl gg_players server_var(_tmp3) level es_keygetvalue p_wpn gg_weapons server_var(p_lvl) weapon es_fire server_var(_tmp3) env_hudhint kill es_give server_var(_tmp3) env_hudhint es_format tmp_menumsg "message You are now on level %1 (%2)" server_var(p_lvl) server_var(p_wpn) es_fire server_var(_tmp3) env_hudhint AddOutput server_var(tmp_menumsg) es_fire server_var(_tmp3) env_hudhint ShowHudHint es_format p_wpn "weapon_%1" server_var(p_wpn) if (server_var(p_wpn) == "weapon_hegrenade") do { es_delayed .05 es_xgive server_var(_tmp3) weapon_hegrenade if (server_var(gg_nade_glock) == 1) do { es_delayed .05 es_xgive server_var(_tmp3) weapon_glock es_delayed .1 es_xsetplayerprop server_var(_tmp3) CCSPlayer.baseclass.localdata.m_iAmmo.006 50 } if (server_var(gg_nade_flash) == 1) do { es_delayed .1 es_xgive server_var(_tmp3) weapon_flashbang } if (server_var(gg_nade_smoke) == 1) do { es_delayed .1 es_xgive server_var(_tmp3) weapon_smokegrenade } if (server_var(gg_ff_auto) == 1) do { if (server_var(mp_friendlyfire) == 0) do { mp_friendlyfire 1 es_xmsg #green Friendly Fire is ON!!! Watch your fire! es_cexec_all play server_var(gg_sound_warning) } } } else do { es_delayed .05 es_xgive server_var(_tmp3) server_var(p_wpn) } if (server_var(p_wpn) != "weapon_knife") then es_xgive server_var(_tmp3) weapon_knife // Give each CT a defuse kit if (server_var(gg_dm_script) != 1) do { if (event_var(es_attackerteam) == 3) do { es_delayed .1 es_xsetplayerprop server_var(_tmp3) CCSPlayer.m_bHasDefuser 1 } } // give them the right ammo for their gun es_keygetvalue gg_ammoname gg_ammo_props server_var(p_wpn) es_keygetvalue gg_ammonum gg_ammo_count server_var(p_wpn) es_delayed .1 es_xsetplayerprop server_var(_tmp3) server_var(gg_ammoname) server_var(gg_ammonum) } block main_reset_player { // Set tmp id es_xgetargv user_id 1 //es uniqueid steam_id server_var(user_id) 1 es_keygetvalue steam_id gg_players server_var(user_id) steamid // afk_db store spawn location es_xsetinfo user_x 0 es_xsetinfo user_y 0 es_xsetinfo user_z 0 es_getplayerlocation user_x user_y user_z server_var(user_id) es_keysetvalue afk_db server_var(user_id) x server_var(user_x) es_keysetvalue afk_db server_var(user_id) y server_var(user_y) // If warmup is over, or knife warmup is off, give weapons if (server_var(gg_knife_warmup) == 1) do { if (server_var(gg_warmup_timer) < 2) then es_xdoblock gungame3/give_player_weapon if (server_var(gg_warmup_timer) > 1) then es_xdoblock gungame3/give_warmup_knife } else do { es_xdoblock gungame3/give_player_weapon } if (server_var(gg_vote) == 1) do { if (server_var(p_lvl) == server_var(gg_level_dynamic)) do { ma_voterandom end 4 es_xsetinfo gg_vote 0 } } if (server_var(gg_vote) == 2) do { if (server_var(p_lvl) == server_var(gg_level_dynamic)) do { es_xdoblock gungame3/gg_voting/map_vote es_xsetinfo gg_vote 0 } } }