Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <fakemeta_util>
- #include <cstrike>
- #include <hamsandwich>
- #include <colorchat>
- #include <fun>
- enum _: Guns
- {
- Gun_Name[ 33 ],
- Gun_GiveWeapon[ 33 ],
- Gun_Weapon
- }
- enum _: Guns2
- {
- GunName[ 33 ],
- GunGiveWeapon[ 33 ],
- GunWeapon
- }
- new const Weapons[ ][ Guns ] = {
- { "M4a1", "weapon_m4a1", CSW_M4A1 },
- { "Ak47", "weapon_ak47", CSW_AK47 },
- { "Awp", "weapon_awp", CSW_AWP },
- { "P90", "weapon_p90", CSW_P90 },
- { "Scout", "weapon_scout", CSW_SCOUT },
- { "M3", "weapon_m3", CSW_M3 },
- { "Aug", "weapon_aug", CSW_AUG },
- { "Famas", "weapon_famas", CSW_FAMAS },
- { "XM1014", "weapon_xm1014", CSW_XM1014 },
- { "UMP", "weapon_ump", CSW_UMP45 },
- { "MP5", "weapon_mp5", CSW_MP5NAVY },
- { "Galil", "weapon_galil", CSW_GALIL },
- { "M249", "weapon_m249", CSW_M249 },
- { "Mac10", "weapon_mac10", CSW_MAC10 },
- { "TMP", "weapon_tmp", CSW_TMP },
- { "SG552", "weapon_sg552", CSW_SG552 },
- { "SG550", "weapon_sg550", CSW_SG550 },
- { "G3SG1", "weapon_g3sg1", CSW_G3SG1 }
- }
- new Pistols[ ][ Guns2 ] = {
- { "Usp", "weapon_usp", CSW_USP },
- { "Glock", "weapon_glock18", CSW_GLOCK18 },
- { "Deagle", "weapon_deagle", CSW_DEAGLE },
- { "Five Seven", "weapon_fiveseven", CSW_FIVESEVEN },
- { "p228", "weapon_p228", CSW_P228 },
- { "Elite", "weapon_elite", CSW_ELITE }
- }
- new Prefix[] = "Fun"
- new GotGuns[ 32 ] = false
- new Weapon[ 33 ]
- new Pistol[ 33 ]
- new bool:DontShowAgain[ 33 ] = false
- new bool:chosenguns[ 33 ] = false
- public plugin_init() {
- register_plugin("Death Match", "2.0", "ISRaiyaN")
- register_clcmd("say /show", "ShowGunsMenu")
- register_clcmd("say /guns", "GunsMenu")
- register_clcmd("gunsmenu", "GunsMenu")
- register_logevent( "GunsMenu_RoundStart", 2, "1=Round_Start" )
- register_forward( FM_PlayerPreThink, "PlayerPreThink", 1 );
- }
- public client_putinserver(id)
- GotGuns[id] = false
- public PlayerPreThink(id)
- {
- if( cs_get_user_team(id) == CS_TEAM_CT )
- set_task(2.0, "Respawn", id)
- if( cs_get_user_team(id) == CS_TEAM_T )
- set_task(2.0, "Respawn", id)
- }
- public GunsMenu_RoundStart()
- client_cmd(0, "gunsmenu" )
- public Respawn(id)
- {
- if(!is_user_alive(id) && is_user_connected(id))
- {
- GotGuns[id] = false
- ExecuteHamB( Ham_CS_RoundRespawn, id )
- PlayerSpawn(id)
- }
- return 1;
- }
- public PlayerSpawn(id)
- {
- fm_DispatchSpawn(id)
- set_user_godmode(id, 1 )
- set_task(1.0, "GunsMenu", id )
- set_task(5.0, "StopGodmode", id )
- }
- public StopGodmode(id)
- {
- set_user_godmode(id)
- }
- public GunsMenu(id, item)
- {
- if( GotGuns[id] )
- {
- ColorChat(id, RED, "^3[ ^1%s ^3] ^1You have ^3Already Guns.", Prefix )
- return 1;
- }
- else if( DontShowAgain[id] )
- {
- GiveGuns(id, item)
- ColorChat(id, RED, "^4[ ^3%s ^4] ^1Your ^3Guns Menu ^1is ^4Disabled^1, Type: ^3/show ^1for ^4Show Guns Menu", Prefix )
- return 2;
- }
- else
- {
- new Text[2000]
- formatex( Text, charsmax( Text ), "\r[\y %s \r]\w Equip Guns", Prefix )
- new GunMenu = menu_create( Text, "Guns_handler" )
- menu_additem(GunMenu, "Choose Weapon" )
- menu_additem(GunMenu, "Your Chosen Weapon" )
- menu_additem(GunMenu, "Dont Show Again \d( Same Guns )" )
- menu_setprop(GunMenu, MPROP_EXIT, MEXIT_ALL )
- menu_display(id, GunMenu, 0)
- return 1;
- }
- return 1;
- }
- public Guns_handler(id, GunMenu, item)
- {
- switch( item )
- {
- case 0: WeaponMenu(id)
- case 1:
- {
- if( chosenguns[id] )
- GiveGuns(id, item)
- else
- {
- GunsMenu(id, item)
- ColorChat(id, RED, "^4[ ^3%s ^4] ^1You must choose a weapon before", Prefix )
- }
- }
- case 2:
- {
- if( chosenguns[id] )
- {
- DontShowAgain[id] = true
- ColorChat(id, RED, "^4[ ^3%s ^4] ^1To Enable Type: ^3/show", Prefix )
- GiveGuns(id, item)
- }
- else
- {
- GunsMenu(id, item)
- ColorChat(id, RED, "^4[ ^3%s ^4] ^1You must choose a weapon before", Prefix )
- }
- }
- }
- }
- public ShowGunsMenu(id)
- {
- ColorChat(id, RED, "^4[ ^3%s ^4] ^1You have ^3%s ^1Show Guns Menu", Prefix, DontShowAgain[id] ? "Enabled" : "Disabled" )
- DontShowAgain[id] = !DontShowAgain[id]
- return 1;
- }
- public WeaponMenu(id)
- {
- new Text[2000]
- formatex( Text, charsmax( Text ), "\r[\y %s \r]\w Choose Weapon^nPage: \r", Prefix )
- new iMenu = menu_create( Text, "Weapon_handler" )
- for ( new i; i < sizeof Weapons; i++ )
- menu_additem( iMenu, Weapons[ i ][ Gun_Name ] )
- menu_setprop( iMenu, MPROP_EXIT, MEXIT_ALL )
- menu_display( id, iMenu )
- return 1;
- }
- public Weapon_handler( id, iMenu, item )
- {
- if( item == MENU_EXIT )
- menu_destroy( iMenu )
- Weapon[id] = item
- PistolMenu(id)
- }
- public PistolMenu(id)
- {
- new Text[2000]
- formatex( Text, charsmax( Text ), "\r[\y %s \r]\w Choose Pistol", Prefix )
- new iMenu2 = menu_create( Text, "Pistol_handler" )
- for ( new i; i < sizeof Pistols; i++ )
- menu_additem( iMenu2, Pistols[ i ][ GunName ] )
- menu_setprop( iMenu2, MPROP_EXIT, MEXIT_ALL )
- menu_display( id, iMenu2 )
- }
- public Pistol_handler( id, iMenu2, item )
- {
- if( item == MENU_EXIT )
- {
- menu_destroy( iMenu2 )
- return 1;
- }
- Pistol[id] = item
- GiveGuns(id, item)
- return 1;
- }
- public GiveGuns(id, item)
- {
- ColorChat(id, RED, "^4[ ^3%s ^4] ^3Successfully, ^1You got ^4Guns", Prefix )
- fm_strip_user_weapons( id )
- fm_give_item( id, "weapon_knife" )
- fm_give_item( id, "weapon_smokegrenade" )
- fm_give_item( id, "weapon_flashbang" )
- fm_give_item( id, "weapon_hegrenade" )
- fm_give_item( id, Weapons[ Weapon[id] ][ Gun_GiveWeapon ] )
- fm_give_item( id, Pistols[ Pistol[id] ][ GunGiveWeapon ] )
- cs_set_user_armor( id, 100, CS_ARMOR_KEVLAR )
- cs_set_user_bpammo(id, Weapons[ Weapon[id] ][ Gun_Weapon ], 9000 )
- cs_set_user_bpammo(id, Pistols[ Pistol[id] ][ GunWeapon ], 900 )
- GotGuns[id] = true
- chosenguns[id] = true
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement