Guest User

Untitled

a guest
Oct 23rd, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.26 KB | None | 0 0
  1. /* Plugin generated by AMXX-Studio */
  2.  
  3. #include <amxmodx>
  4. #include <amxmisc>
  5. #include <fun>
  6.  
  7.  
  8.  
  9.  
  10.  
  11. #define PLUGIN "WeaponsGiver"
  12. #define VERSION "1.0"
  13. #define AUTHOR "bluR_^"
  14.  
  15.  
  16. public plugin_init() {
  17.     register_clcmd("exec csdeath.cfg", "BlockCommand");
  18.     register_clcmd("say /awp", "giveAwp")
  19.     register_clcmd("say /scout", "giveScout")
  20.     register_clcmd("say /deagle", "giveDeagle")
  21.     register_clcmd("say /usp", "giveUsp")
  22.     register_clcmd("say /m4a1", "giveM4a1")
  23.     register_clcmd("say /ak47", "giveAk47")
  24.     register_clcmd("say /glock", "giveGlock")
  25.     register_clcmd("say /he", "giveHe")
  26.     register_clcmd("say /flash", "giveFlash")
  27.     register_clcmd("say /smoke", "giveSmoke")
  28.     register_clcmd("say /c4", "C4")
  29.     register_clcmd("say /p90", "giveP90")
  30.     register_clcmd("say /all", "giveAll")
  31.     register_clcmd("say /famas", "giveFamas")
  32.     register_clcmd("say /galil", "giveGalil")
  33.     register_clcmd("say /aug", "giveAug")
  34.     register_clcmd("say /nades", "giveNades")
  35.     register_clcmd("say /pistols", "givePistols")
  36.     register_clcmd("say /menu", "MainMenus")
  37.     register_clcmd("amx_MainMenu_Handler", "MainMenus_Handler")
  38.     register_clcmd("amx_automassager", "AutoMessage")
  39.     new MainMenus = register_menuid("@f0rce");
  40.     register_menucmd(MainMenus, 1023, "MenuName_Handler");
  41.     set_task(200.0, "AutoMessage",_,_,_, "b");
  42. }
  43. public giveAwp(client)
  44.  
  45. {
  46.  
  47.          give_item(client, "weapon_awp")
  48. }
  49. public giveScout(client)
  50.  
  51. {
  52.  
  53.          give_item(client, "weapon_scout")
  54. }
  55.  public giveDeagle(client)
  56.  
  57. {
  58.  
  59.          give_item(client, "weapon_deagle")
  60. }
  61. public giveUsp(client)
  62. {
  63.     give_item(client, "weapon_usp")
  64. }
  65.  public giveM4a1(client)
  66.  
  67.  {
  68.  
  69.     give_item(client, "weapon_m4a1")
  70. }
  71. public giveAk47(client)
  72.  
  73. {
  74.  
  75.     give_item(client, "weapon_ak47")
  76. }
  77. public giveGlock(client)
  78.  
  79. {
  80.  
  81.     give_item(client, "weapon_glock")
  82. }
  83. public giveHe(client)
  84.    
  85. {
  86.  
  87.  
  88.     give_item(client, "weapon_hegrenade")
  89. }
  90. public giveFlash(client)
  91. {
  92.  
  93.     give_item(client, "weapon_flashbang")
  94. }
  95. public giveSmoke(client)
  96.  
  97. {
  98.  
  99.     give_item(client, "weapon_smokegrenade")
  100. }
  101.  
  102. public C4(client)
  103.  
  104. {
  105.  
  106.     give_item(client, "weapon_c4")
  107. }
  108. public giveP90(client)
  109.  
  110. {
  111.  
  112.     give_item(client, "weapon_p90")
  113. }
  114. public giveAll(client)
  115.  
  116. {
  117.  
  118.     give_item(client, "weapon_p90")
  119.     give_item(client, "weapon_c4")
  120.     give_item(client, "weapon_smokegrenade")
  121.     give_item(client, "weapon_flashbang")
  122.     give_item(client, "weapon_flashbang")
  123.     give_item(client, "weapon_hegrenade")
  124.     give_item(client, "weapon_glock")
  125.     give_item(client, "weapon_ak47")
  126.     give_item(client, "weapon_m4a1")
  127.     give_item(client, "weapon_usp")
  128.     give_item(client, "weapon_deagle")
  129.     give_item(client, "weapon_scout")
  130.     give_item(client, "weapon_awp")
  131.     give_item(client, "weapon_c4")
  132.     give_item(client, "weapon_famas")
  133.     give_item(client, "weapon_galil")
  134.     give_item(client, "weapon_aug")
  135. }
  136. public giveFamas(client)
  137.  
  138. {
  139.    
  140.     give_item(client, "weapon_famas")
  141. }
  142. public giveGalil(client)
  143.  
  144. {
  145.  
  146.     give_item(client, "weapon_galil")
  147. }
  148.  
  149. public giveAug(client)
  150.  
  151. {
  152.  
  153.     give_item(client, "weapon_aug")
  154. }
  155. public giveNades(client)
  156.  
  157. {
  158.  
  159.     give_item(client, "weapon_flashbang")
  160.     give_item(client, "weapon_flashbang")
  161.     give_item(client, "weapon_hegrenade")
  162.     give_item(client, "weapon_smokegrenade")
  163. }
  164. public givePistols(client)
  165.  
  166. {
  167.  
  168.     give_item(client, "weapon_deagle")
  169.     give_item(client, "weapon_usp")
  170.     give_item(client, "weapon_glock")
  171.     give_item(client, "weapon_elite")
  172.     give_item(client, "weapon_fiveseven")
  173.     give_item(client, "weapon_p228")
  174. }
  175. public MainMenus(id) {
  176.     new szBuffer[512], iLen;
  177.  
  178.     iLen = formatex(szBuffer, sizeof szBuffer - 1, "\yWeaponsGiver Menu By /rbluR.^n"); // Koteret
  179.     iLen += formatex(szBuffer[iLen], (sizeof szBuffer - 1) - iLen, "\r1. \wAwp^n"); // Efsharot 1
  180.     iLen += formatex(szBuffer[iLen], (sizeof szBuffer - 1) - iLen, "\r2. \wScout^n"); // Efsharot 2
  181.     iLen += formatex(szBuffer[iLen], (sizeof szBuffer - 1) - iLen, "\r3. \wDeagle^n"); // Efsharot 3
  182.    
  183.    
  184.     iLen += formatex(szBuffer[iLen], (sizeof szBuffer - 1) - iLen, "\r0. \yExit");
  185.  
  186.     new iKeys = ( 1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<4 | 1<<5 | 1<<6 | 1<<7 | 1<< 9);
  187.     show_menu(id, iKeys, szBuffer, -1, "@f0rce");
  188.  
  189. }
  190. public MainMenus_Handler(id, key) {
  191.     switch(key) {
  192.         case 0: {
  193.            
  194.             give_item(id, "weapon_awp");
  195.             ChatColor(id, "You Got Awp.");
  196.         }
  197.         case 1: {
  198.            
  199.             give_item(id, "weapon_scout");
  200.             ChatColor(id, "You Got Scout.");
  201.         }
  202.         case 2: {
  203.            
  204.             give_item(id, "weapon_deagle");
  205.             ChatColor(id, "You Got Deagle.");
  206.         }
  207.        
  208.        
  209.         case 9: return PLUGIN_HANDLED;
  210.     }
  211.     return PLUGIN_HANDLED;
  212. }
  213. public AutoMessage()
  214. {
  215.    
  216.     ChatColor(0, "^x01 This server running^x04 Weapon Giver^x01 mod, type^x03 Any Weapon Name like this^x01 - ^x03 /awp^x01.");
  217. }
  218.  
  219.  
  220. stock ChatColor(const id, const string[], {Float, Sql, Resul,_}:...) {
  221.     new msg[191], players[32], count = 1
  222.    
  223.     static len
  224.     len = formatex(msg, charsmax(msg), "^x04[^x03 WeaponsGiver^x04 ]^x01 ")
  225.     vformat(msg[len], charsmax(msg) - len, string, 3)
  226.  
  227.     if(id)
  228.         players[0] = id
  229.     else
  230.         get_players(players,count,"ch")
  231.    
  232.     for (new i = 0; i < count; i++) {
  233.         if(is_user_connected(players[i]))
  234.         {
  235.             message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"),_, players[i])
  236.             write_byte(players[i])
  237.             write_string(msg)
  238.             message_end()
  239.         }
  240.     }
  241. }
  242.  
  243. public BlockCommand(id)
  244.     return PLUGIN_HANDLED;
Add Comment
Please, Sign In to add comment