Advertisement
ISRaiyaN

Death Match - New

Oct 27th, 2019
475
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 5.86 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <fakemeta_util>
  3. #include <cstrike>
  4. #include <hamsandwich>
  5. #include <colorchat>
  6. #include <fun>
  7.  
  8. enum _: Guns
  9. {
  10.     Gun_Name[ 33 ],
  11.     Gun_GiveWeapon[ 33 ],
  12.     Gun_Weapon
  13. }
  14.  
  15. enum _: Guns2
  16. {
  17.     GunName[ 33 ],
  18.     GunGiveWeapon[ 33 ],
  19.     GunWeapon
  20. }
  21.  
  22. new const Weapons[ ][ Guns ] =  {
  23.     { "M4a1", "weapon_m4a1", CSW_M4A1 },
  24.     { "Ak47", "weapon_ak47", CSW_AK47 },
  25.     { "Awp", "weapon_awp", CSW_AWP },
  26.     { "P90", "weapon_p90", CSW_P90 },
  27.     { "Scout", "weapon_scout", CSW_SCOUT },
  28.     { "M3", "weapon_m3", CSW_M3 },
  29.     { "Aug", "weapon_aug", CSW_AUG },
  30.     { "Famas", "weapon_famas", CSW_FAMAS },
  31.     { "XM1014", "weapon_xm1014", CSW_XM1014 },
  32.     { "UMP", "weapon_ump", CSW_UMP45 },
  33.     { "MP5", "weapon_mp5", CSW_MP5NAVY },
  34.     { "Galil", "weapon_galil", CSW_GALIL },
  35.     { "M249", "weapon_m249", CSW_M249 },
  36.     { "Mac10", "weapon_mac10", CSW_MAC10 },
  37.     { "TMP", "weapon_tmp", CSW_TMP },
  38.     { "SG552", "weapon_sg552", CSW_SG552 },
  39.     { "SG550", "weapon_sg550", CSW_SG550 },
  40.     { "G3SG1", "weapon_g3sg1", CSW_G3SG1 }
  41.    
  42. }
  43.  
  44. new Pistols[ ][ Guns2 ] = {
  45.     { "Usp", "weapon_usp", CSW_USP },
  46.     { "Glock", "weapon_glock18", CSW_GLOCK18 },
  47.     { "Deagle", "weapon_deagle", CSW_DEAGLE },
  48.     { "Five Seven", "weapon_fiveseven", CSW_FIVESEVEN },
  49.     { "p228", "weapon_p228", CSW_P228 },
  50.     { "Elite", "weapon_elite", CSW_ELITE }
  51. }
  52.  
  53. new Prefix[] = "Fun"
  54. new GotGuns[ 32 ] = false
  55. new Weapon[ 33 ]
  56. new Pistol[ 33 ]
  57.  
  58. new bool:DontShowAgain[ 33 ] = false
  59. new bool:chosenguns[ 33 ] = false
  60.  
  61. public plugin_init() {
  62.     register_plugin("Death Match", "2.0", "ISRaiyaN")
  63.    
  64.     register_clcmd("say /show", "ShowGunsMenu")
  65.     register_clcmd("say /guns", "GunsMenu")
  66.     register_clcmd("gunsmenu", "GunsMenu")
  67.  
  68.     register_logevent( "GunsMenu_RoundStart", 2, "1=Round_Start" )
  69.    
  70.     register_forward( FM_PlayerPreThink, "PlayerPreThink", 1 );
  71. }
  72. public client_putinserver(id)
  73.     GotGuns[id] = false
  74.  
  75. public PlayerPreThink(id)
  76. {
  77.     if( cs_get_user_team(id) == CS_TEAM_CT )
  78.         set_task(2.0, "Respawn", id)
  79.    
  80.     if( cs_get_user_team(id) == CS_TEAM_T )
  81.         set_task(2.0, "Respawn", id)
  82. }
  83.  
  84. public GunsMenu_RoundStart()
  85.     client_cmd(0, "gunsmenu" )
  86.  
  87. public Respawn(id)
  88. {
  89.     if(!is_user_alive(id) && is_user_connected(id))
  90.     {
  91.         GotGuns[id] = false
  92.        
  93.         ExecuteHamB( Ham_CS_RoundRespawn, id )
  94.         PlayerSpawn(id)
  95.  
  96.     }
  97.     return 1;
  98. }
  99.  
  100. public PlayerSpawn(id)
  101. {
  102.     fm_DispatchSpawn(id)
  103.     set_user_godmode(id, 1 )
  104.    
  105.     set_task(1.0, "GunsMenu", id )
  106.    
  107.     set_task(5.0, "StopGodmode", id )
  108. }
  109.  
  110. public StopGodmode(id)
  111. {
  112.     set_user_godmode(id)
  113. }
  114.  
  115. public GunsMenu(id, item)
  116. {
  117.     if( GotGuns[id] )
  118.     {
  119.         ColorChat(id, RED, "^3[ ^1%s ^3] ^1You have ^3Already Guns.", Prefix )
  120.         return 1;
  121.     }
  122.     else if( DontShowAgain[id] )
  123.     {
  124.         GiveGuns(id, item)
  125.         ColorChat(id, RED, "^4[ ^3%s ^4] ^1Your ^3Guns Menu ^1is ^4Disabled^1, Type: ^3/show ^1for ^4Show Guns Menu", Prefix )
  126.         return 2;
  127.     }
  128.     else
  129.     {
  130.         new Text[2000]
  131.    
  132.         formatex( Text, charsmax( Text ), "\r[\y %s \r]\w Equip Guns", Prefix )
  133.         new GunMenu = menu_create( Text, "Guns_handler" )
  134.    
  135.         menu_additem(GunMenu, "Choose Weapon" )
  136.         menu_additem(GunMenu, "Your Chosen Weapon" )
  137.         menu_additem(GunMenu, "Dont Show Again \d( Same Guns )" )
  138.    
  139.         menu_setprop(GunMenu, MPROP_EXIT, MEXIT_ALL )
  140.    
  141.         menu_display(id, GunMenu, 0)
  142.        
  143.         return 1;
  144.     }
  145.     return 1;
  146. }
  147.  
  148. public Guns_handler(id, GunMenu, item)
  149. {
  150.     switch( item )
  151.     {
  152.         case 0: WeaponMenu(id)
  153.         case 1:
  154.         {
  155.             if( chosenguns[id] )
  156.                 GiveGuns(id, item) 
  157.             else
  158.             {
  159.                 GunsMenu(id, item)
  160.                 ColorChat(id, RED, "^4[ ^3%s ^4] ^1You must choose a weapon before", Prefix )
  161.             }
  162.         }
  163.         case 2:
  164.         {
  165.             if( chosenguns[id] )
  166.             {
  167.                 DontShowAgain[id] = true
  168.                 ColorChat(id, RED, "^4[ ^3%s ^4] ^1To Enable Type: ^3/show", Prefix )
  169.                 GiveGuns(id, item) 
  170.             }
  171.             else
  172.             {
  173.                 GunsMenu(id, item)
  174.                 ColorChat(id, RED, "^4[ ^3%s ^4] ^1You must choose a weapon before", Prefix )
  175.             }
  176.         }
  177.     }
  178. }
  179.  
  180. public ShowGunsMenu(id)
  181. {
  182.     ColorChat(id, RED, "^4[ ^3%s ^4] ^1You have ^3%s ^1Show Guns Menu", Prefix, DontShowAgain[id] ? "Enabled" : "Disabled" )
  183.     DontShowAgain[id] = !DontShowAgain[id]
  184.    
  185.     return 1;
  186. }
  187.  
  188. public WeaponMenu(id)
  189. {
  190.     new Text[2000]
  191.    
  192.     formatex( Text, charsmax( Text ), "\r[\y %s \r]\w Choose Weapon^nPage: \r", Prefix )
  193.    
  194.     new iMenu = menu_create( Text, "Weapon_handler" )
  195.    
  196.     for ( new i; i < sizeof Weapons; i++ )
  197.     menu_additem( iMenu, Weapons[ i ][ Gun_Name ] )
  198.    
  199.     menu_setprop( iMenu, MPROP_EXIT, MEXIT_ALL )
  200.     menu_display( id, iMenu )
  201.    
  202.     return 1;
  203. }
  204.  
  205. public Weapon_handler( id, iMenu, item )
  206. {
  207.     if( item == MENU_EXIT )
  208.         menu_destroy( iMenu )
  209.    
  210.     Weapon[id] = item
  211.    
  212.     PistolMenu(id)
  213. }
  214.  
  215. public PistolMenu(id)
  216. {
  217.     new Text[2000]
  218.    
  219.     formatex( Text, charsmax( Text ), "\r[\y %s \r]\w Choose Pistol", Prefix )
  220.    
  221.     new iMenu2 = menu_create( Text, "Pistol_handler" )
  222.    
  223.     for ( new i; i < sizeof Pistols; i++ )
  224.     menu_additem( iMenu2, Pistols[ i ][ GunName ] )
  225.    
  226.     menu_setprop( iMenu2, MPROP_EXIT, MEXIT_ALL )
  227.     menu_display( id, iMenu2 )
  228. }
  229.  
  230. public Pistol_handler( id, iMenu2, item )
  231. {
  232.     if( item == MENU_EXIT )
  233.     {
  234.     menu_destroy( iMenu2 )
  235.     return 1;
  236.     }
  237.    
  238.     Pistol[id] = item
  239.    
  240.     GiveGuns(id, item)
  241.    
  242.     return 1;
  243. }
  244.  
  245. public GiveGuns(id, item)
  246. {
  247.     ColorChat(id, RED, "^4[ ^3%s ^4] ^3Successfully, ^1You got ^4Guns", Prefix )
  248.    
  249.     fm_strip_user_weapons( id )
  250.  
  251.     fm_give_item( id, "weapon_knife" )
  252.     fm_give_item( id, "weapon_smokegrenade" )
  253.     fm_give_item( id, "weapon_flashbang" )
  254.     fm_give_item( id, "weapon_hegrenade" )
  255.     fm_give_item( id, Weapons[ Weapon[id] ][ Gun_GiveWeapon ] )
  256.     fm_give_item( id, Pistols[ Pistol[id] ][ GunGiveWeapon ] )
  257.    
  258.     cs_set_user_armor( id, 100, CS_ARMOR_KEVLAR )
  259.    
  260.     cs_set_user_bpammo(id, Weapons[ Weapon[id] ][ Gun_Weapon ], 9000 )
  261.     cs_set_user_bpammo(id, Pistols[ Pistol[id] ][ GunWeapon ], 900 )
  262.    
  263.     GotGuns[id] = true
  264.     chosenguns[id] = true
  265. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement