//--------------------------------------------------------------------------------------------- // Full Load v0.05 by Don Lafferty // 5/2006 // // Description: This EventScripts addon modifies Counter-Strike:Source // by giving players guns and grenades at spawn. The only // weapons given are m4a1 or ak47, hegrenade, and dual elites. // Those can be changed by editing the script. The script // also adds a few sounds for some events. // // Features: !switch - Switch from primary rifle to awp and back again // !heg - Get a High Energy Grenade in your hand immediately // !rebuy - Get a M4A1 or AK47 with full ammo // !autobuy - Get a Full Load of weapons and ammo // // Tells you when the bomb is being defused // Tells you when the bomb was dropped // Tells you when you are getting low on ammo(reload) // // Caveat: The smoke grenade might be removed if someone joins the // game while you are in the middle of a round. This script // also sets eventscripts_noisy 1 on load and back to 0 on // unload. // // Requirements: EventScripts v1.0+ // ES_Tools v0.39+ // Mani Admin v1.1? // // Installation: Put this file into cstrike/addons/eventscripts/full_load/es_full_load.txt // Add this line to your autoexec.cfg es_load full_load // Add the sound files to cstrike/sound/admin_plugin/ // kitdefuse.mp3 // begindefuse.mp3 // bombdropped.mp3 // reload.mp3 // // Add the soundfile names to your mani soundlist.txt so they will be // downloaded by the client. // Reboot the server and have fun. // // Note: The commands are not supported in player_say so they have to be from // the console or a bound key. // //------------------------------------------------------------------------------------------------ block load { es_xsetinfo lastt 0 es_xsetinfo botchk 0 es_xsetinfo lastbomber 0 es_xsetinfo teamcheck 0 es_xsetinfo spawntype 0 es_xsetinfo whattype 0 es_setinfo rifletogive weapon_awp es_setinfo c4user 0 es_xsetinfo roundstarted 0 es_xsetinfo deadflag 0 es_xsetinfo primary 0 es_xsetinfo secondary 0 es_xsetinfo hasfb 0 es_xsetinfo hashe 0 es_xsetinfo hassb 0 es_xsetinfo hasc4 0 es_xsetinfo mainrifle 0 es_setinfo kindex 0 es_setinfo kvalue 0 es_setinfo owner 0 es_setinfo howner 0 es_setinfo gun 0 es_setinfo botchk 0 es_setinfo clipindex 0 es_setinfo bullets 0 es_setinfo found 0 es_keygroupcreate players es_setinfo oldnoisy server_var(eventscripts_noisy) es_setinfo eventscripts_noisy 1 } block unload { es_setinfo eventscripts_noisy server_var(oldnoisy) } //---------------------------------------------------------------------------------------------------------------- event bomb_begindefuse { if (event_var(haskit) equalto 1) then es_cexec_all playgamesound admin_plugin/kitdefuse.mp3 if (event_var(haskit) equalto 0) then es_cexec_all playgamesound admin_plugin/begindefuse.mp3 if (event_var(haskit) equalto 1) then es_msg #green "HE HAS A DEFUSE KIT!" if (event_var(haskit) equalto 0) then es_msg #lightgreen "No defuse kit being used" } //---------------------------------------------------------------------------------------------------------------- event bomb_dropped { es_isbot botchk event_var(userid) if (server_var(botchk) equalto 0) do { es_math lastbomber subtract 1 if (server_var(lastbomber) greaterthan 0) then es_cexec_all playgamesound admin_plugin/bombdropped.mp3 } } //---------------------------------------------------------------------------------------------------------------- event round_start { es_xsetinfo roundstarted 1 es_xsetinfo autobuydelay 1 es_delayed 3 es_xsetinfo autobuydelay 0 es_delayed 3 es_msg #multi #green[#lightgreen::Autobuy Available Now::#green] } //---------------------------------------------------------------------------------------------------------------- event round_end { es_xsetinfo roundstarted 0 } //---------------------------------------------------------------------------------------------------------------- event player_activate { es_isbot botchk event_var(userid) if (server_var(botchk) = 0) do { es_keysetvalue event_var(es_username) onteam 0 es_remove weapon_smokegrenade es_createentitylist sgrenade weapon_smokegrenade es_give event_var(userid) weapon_smokegrenade es_keygroupdelete sgrenade es_getentityindex kindex weapon_smokegrenade es_getindexprop kvalue server_var(kindex) "CSmokeGrenade.baseclass.baseclass.baseclass.m_hOwner" es_createentitylist sgrenade weapon_smokegrenade es_remove weapon_smokegrenade es_keygroupdelete sgrenade es_keysetvalue players event_var(userid) owner server_var(kvalue) es_keysetvalue players event_var(userid) foundindex 1 } } //---------------------------------------------------------------------------------------------------------------- event player_spawn { es_xsetinfo c4user 0 es_xsetinfo botchk 0 es_xsetinfo autobuydelay 1 //Check if bot or human es_isbot botchk event_var(userid) es_getplayercount lastt 2 es_getplayercount lastbomber 2 //If human then run the script if (server_var(botchk) = 0) do { es_keygetvalue spawntype event_var(es_username) rifletype es_keygetvalue teamcheck event_var(es_username) onteam if (server_var(teamcheck) = 1) do { if (server_var(spawntype) = 0) do { mani_use_amx_style_menu 1 es ma_msay 0 event_var(userid) "Select Primary Rifle\n\n1 M4A1\n2 AK47\n0 Cancel" mani_use_amx_style_menu 0 } else do { es_doblock full_load/autobuy } } } } //---------------------------------------------------------------------------------------------------------------- event item_pickup { // Check if bot or human es_isbot botchk event_var(userid) if (server_var(botchk) = 0) do { es_keygetvalue found players event_var(userid) foundindex if (server_var(found) = 0) do { if (event_var(item) = smokegrenade) then es_remove weapon_smokegrenade } if (event_var(item) = m4a1) do { es_keygetvalue owner players event_var(userid) owner es_createentitylist m4a1 weapon_m4a1 es_foreachkey gun in m4a1 "es_doblock full_load/findm4a1" es_keygroupdelete m4a1 } if (event_var(item) = ak47) do { es_keygetvalue owner players event_var(userid) owner es_createentitylist ak47 weapon_ak47 es_foreachkey gun in ak47 "es_doblock full_load/findak47" es_keygroupdelete ak47 } } } //---------------------------------------------------------------------------------------------------------------- event es_client_command { if (event_var(command) equalto menuselect) do { es_doblock full_load/handlemenu } if (event_var(command) equalto !autobuy) do { if (server_var(autobuydelay) = 0) do { es_doblock full_load/autobuy } else do { es_tell event_var(userid) #multi #lightgreenAUTOBUY #greenNOT AVAILABLE #lightgreenYET! } } if (event_var(command) equalto !rebuy) do { es_doblock full_load/rebuy } if (event_var(command) equalto !switch) do { es_doblock full_load/switcher } if (event_var(command) equalto !heg) do { es_give event_var(userid) weapon_hegrenade es_cexec event_var(userid) use weapon_hegrenade } } //---------------------------------------------------------------------------------------------------------------- event player_team { //Check if bot or human es_isbot botchk event_var(userid) if (server_var(botchk) equalto 0) do { es_xsetinfo spectator 0 es_getplayerteam spectator event_var(userid) if (server_var(spectator) < 3) then es_keysetvalue event_var(es_username) onteam 1 } } //---------------------------------------------------------------------------------------------------------------- event player_connect { //Check if bot or human es_isbot botchk event_var(userid) if (server_var(botchk) = 0) do { es_keycreate event_var(name) es_keysetvalue event_var(name) onteam 0 es_keysetvalue event_var(name) rifletype 0 es_keysetvalue event_var(name) activerifle 0 es_keysetvalue event_var(name) inclip 0 es_keycreate players event_var(userid) es_keysetvalue players event_var(userid) owner 0 es_keysetvalue players event_var(userid) index 0 es_keysetvalue players event_var(userid) foundindex 0 } } //---------------------------------------------------------------------------------------------------------------- event player_disconnect { //Check if bot or human es_isbot botchk event_var(userid) if (server_var(botchk) = 0) do { es_keydelete event_var(es_username) es_keydelete players event_var(userid) } } //---------------------------------------------------------------------------------------------------------------- block autobuy { es_createplayerlist dead event_var(userid) es_keygetvalue deadflag dead event_var(userid) isdead if (server_var(deadflag) equalto 0) do { es_xsetinfo whattype 0 es_xsetinfo whichactive 0 es_setinfo c4user 0 es est_IsBomber c4user event_var(userid) es_keygetvalue whattype event_var(es_username) rifletype es_keygetvalue whichactive event_var(es_username) activerifle es_keysetvalue event_var(es_username) activerifle server_var(whattype) es_keysetvalue event_var(es_username) inclip 30 es_give event_var(userid) player_weaponstrip es_fire event_var(userid) player_weaponstrip strip es_delayed .3 ma_give event_var(es_username) server_var(whattype) es_delayed .3 ma_giveammo event_var(es_username) 0 1 90 1 es_delayed .35 ma_giveammo event_var(es_username) 1 1 120 1 es_delayed .3 ma_give event_var(es_username) item_assaultsuit es_delayed .3 ma_give event_var(es_username) weapon_hegrenade es_delayed .3 ma_give event_var(es_username) weapon_elite es_delayed .3 ma_give event_var(es_username) weapon_knife if (server_var(c4user) equalto 1) then es_delayed .3 es_give event_var(userid) weapon_c4 } es_keygroupdelete dead } //---------------------------------------------------------------------------------------------------------------- block rebuy { mani_use_amx_style_menu 1 es ma_msay 0 event_var(userid) "Select Primary Rifle\n\n1 M4A1\n2 AK47\n0 Cancel" mani_use_amx_style_menu 0 } //---------------------------------------------------------------------------------------------------------------- block handlemenu { if (event_var(commandstring) equalto 1) then es_keysetvalue event_var(es_username) rifletype weapon_m4a1 if (event_var(commandstring) equalto 2) then es_keysetvalue event_var(es_username) rifletype weapon_ak47 if (event_var(commandstring) notequalto 0) do { es_doblock full_load/autobuy } } //---------------------------------------------------------------------------------------------------------------- block switcher { es_give event_var(userid) player_weaponstrip es est_GetPrimary primary event_var(userid) es est_GetSecondary secondary event_var(userid) es est_GetFB hasfb event_var(userid) es est_GetHE hashe event_var(userid) es est_GetSG hassb event_var(userid) es est_IsBomber hasc4 event_var(userid) es_fire event_var(userid) player_weaponstrip strip es_keygetvalue mainrifle event_var(es_username) rifletype if (server_var(primary) = server_var(mainrifle)) do { es_give event_var(userid) weapon_awp } else do { es_give event_var(userid) server_var(mainrifle) } if (server_var(secondary) != 0) then es_soon es_give event_var(userid) server_var(secondary) if (server_var(hasfb) = 1) then es_soon es_give event_var(userid) weapon_flashbang if (server_var(hashe) = 1) then es_soon es_give event_var(userid) weapon_hegrenade if (server_var(hassb) = 1) then es_soon es_give event_var(userid) weapon_smokegrenade if (server_var(hasc4) = 1) then es_soon es_give event_var(userid) weapon_c4 es_soon es_give event_var(userid) weapon_knife es_delayed .5 ma_giveammo event_var(es_username) 0 1 90 1 es_delayed .5 ma_giveammo event_var(es_username) 1 1 90 1 } //---------------------------------------------------------------------------------------------------------------- block findm4a1 { es_keygetvalue howner m4a1 server_var(gun) "CWeaponM4A1.baseclass.baseclass.baseclass.m_hOwner" if (server_var(howner) = server_var(owner)) do { es_keysetvalue players event_var(userid) index server_var(gun) } } //---------------------------------------------------------------------------------------------------------------- block findak47 { es_keygetvalue howner ak47 server_var(gun) "CAK47.baseclass.baseclass.baseclass.m_hOwner" if (server_var(howner) = server_var(owner)) do { es_keysetvalue players event_var(userid) index server_var(gun) } } //---------------------------------------------------------------------------------------------------------------- event weapon_fire { // Check if bot or human es_isbot botchk event_var(userid) if (server_var(botchk) = 0) do { es_keygetvalue clipindex players event_var(userid) index es_getindexprop bullets server_var(clipindex) "CBaseCombatWeapon.LocalWeaponData.m_iClip1" if (server_var(bullets) = 15) then es_xcexec event_var(userid) playgamesound buttons/blip2.wav if (server_var(bullets) = 10) then es_xcexec event_var(userid) playgamesound admin_plugin/reload.mp3 if (server_var(bullets) = 5) then es_xcexec event_var(userid) playgamesound admin_plugin/reload.mp3 } }