SHARE
TWEET

Untitled

a guest Aug 18th, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. Human Classes for zombie plague, menu for classes automatically invoked 8 seconds after player spawn
  3. This plug is far from complete, please help with further development of it since it may have some undesired
  4. results on gameplay. You can edit this plug however it fit your needs.
  5.  
  6. Here is TO DO list:
  7.  
  8. 1. Make B key invoke human class menu
  9. 2. Make user choose class only once per round (could be limited with round timer or some other method) - done
  10. 3. Make user choice remember thru whole map time, just like it was done for zombies
  11. 4. Changing of models is not implemented yet due to numerous bugs and uncertain effects
  12. 5. For now, there are 7 classes only. If you have idea for more classes, make a request
  13. 6. Make classes buyable for ammo packs
  14. 7. Bots support
  15. */
  16.  
  17. #include <amxmodx>
  18. #include <cstrike>
  19. #include <fun>
  20. #include <fakemeta>
  21. #include <hamsandwich>
  22. #include <biohazard>
  23.  
  24. new g_player_class[33]
  25. new bh_human_health
  26.  
  27. public plugin_init()
  28. {
  29.     register_plugin("[BIO] Human Classes", "1.5", "Vitalyzd")
  30.     RegisterHam(Ham_Spawn, "player", "fwHamPlayerSpawnPost", 1)
  31.     bh_human_health = register_cvar( "bh_human_health", "100");
  32. }
  33.  
  34. public fwHamPlayerSpawnPost(id)
  35.  
  36. {
  37.     set_task(get_cvar_float("bh_starttime")+5.0, "ClCmdSelectModel",id)
  38. }
  39.  
  40. public ClCmdSelectModel(id, menuid)
  41. {
  42.     if(is_user_zombie(id))
  43.     {
  44.         return PLUGIN_HANDLED;
  45.     }
  46.  
  47.     else if(!is_user_alive(id))
  48.     {
  49.         return PLUGIN_HANDLED;
  50.     }
  51.     else
  52.     {
  53.         human_menu(id)
  54.     }
  55.     return PLUGIN_CONTINUE;
  56. }
  57.  
  58. public human_menu(id)
  59. {
  60.   new menu = menu_create("[BIO]Choose Human Class:", "human_menu_handler")
  61.   menu_additem(menu, "Armorer (100 Armor)", "1", 0)
  62.   menu_additem(menu, "Pounder (300 HP)", "2", 0)
  63.   menu_additem(menu, "Jumper (Gravity ++)", "3", 0)
  64.   menu_additem(menu, "Flash Soldier (Flash Bomb X 5)", "4", 0)
  65.   menu_additem(menu, "Firebat (HE Bomb X 5)", "5", 0)
  66.   menu_additem(menu, "Light Handler (Light Aura)", "6", 0)
  67.   menu_additem(menu, "Universal Soldier (Admin Class)", "7", ADMIN_BAN);
  68.   menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
  69.   menu_display(id, menu, 0)
  70.  
  71. }
  72. public human_menu_handler(id, menu, item)
  73. {
  74.  if( item == MENU_EXIT )
  75.  {
  76.   menu_destroy(menu)
  77.   return PLUGIN_HANDLED
  78.  }
  79.  new data[6], iName[64]
  80.  new access, callback
  81.  menu_item_getinfo(menu, item, access, data, 5, iName, 63, callback)
  82.  new key = str_to_num(data)
  83.  switch(key)
  84.  {
  85.   case 1:
  86.   {
  87.    if(is_user_zombie(id)) return PLUGIN_HANDLED;
  88.    g_player_class[id] = 1
  89.    set_user_health(id, get_pcvar_num(bh_human_health))
  90.    set_user_armor(id, 200)
  91.    set_user_gravity(id, 1.00)
  92.    client_print(id, print_chat,"[BIO] Armorer (200 Armor)")
  93.   }
  94.   case 2:
  95.   {
  96.    if(is_user_zombie(id)) return PLUGIN_HANDLED;
  97.    g_player_class[id] = 2
  98.    set_user_health(id, 300)
  99.    set_user_armor(id, 0)
  100.    set_user_gravity(id, 1.00)
  101.    client_print(id, print_chat,"[BIO] Pounder (300 HP)");
  102.   }
  103.   case 3:
  104.   {
  105.    if(is_user_zombie(id)) return PLUGIN_HANDLED;
  106.    g_player_class[id] = 3
  107.    set_user_health(id, get_pcvar_num(bh_human_health))
  108.    set_user_armor(id, 0)
  109.    set_user_gravity(id, 0.50)
  110.    client_print(id, print_chat,"[BIO] Jumper (Gravity is 1/2)");
  111.   }
  112.   case 4:
  113.   {
  114.    if(is_user_zombie(id)) return PLUGIN_HANDLED;
  115.    g_player_class[id] = 4
  116.    set_user_health(id, get_pcvar_num(bh_human_health))
  117.    set_user_armor(id, 30)
  118.    set_user_gravity(id, 1.00)
  119.    cs_set_user_bpammo(id, CSW_FLASHBANG, 5)
  120.    client_print(id, print_chat,"[BIO] FLASH Soldier (+5 FlashBomb)");
  121.   }
  122.   case 5:
  123.   {
  124.    if(is_user_zombie(id)) return PLUGIN_HANDLED;
  125.    g_player_class[id] = 5
  126.    set_user_health(id, get_pcvar_num(bh_human_health))
  127.    set_user_armor(id, 40)
  128.    set_user_gravity(id, 1.00)
  129.    cs_set_user_bpammo(id, CSW_HEGRENADE, 5)
  130.    client_print(id, print_chat,"[BIO] Firebat (+5 He Granade)")
  131.   }
  132.   case 6:
  133.   {
  134.    if(is_user_zombie(id)) return PLUGIN_HANDLED;
  135.    g_player_class[id] = 6
  136.    set_user_health(id, get_pcvar_num(bh_human_health))
  137.    set_user_armor(id, 0)
  138.    set_user_gravity(id, 1.00)
  139.    set_pev(id, pev_effects, pev(id, pev_effects) | EF_BRIGHTLIGHT)
  140.    client_print(id, print_chat,"[BIO] Light Handler (Light Aura)");
  141.   }
  142.   case 7:
  143.   {
  144.    if(is_user_zombie(id)) return PLUGIN_HANDLED;
  145.    g_player_class[id] = 7
  146.    set_user_health(id, 255)
  147.    set_user_armor(id, 500)
  148.    set_user_gravity(id, 1.00)
  149.    cs_set_user_bpammo(id, CSW_HEGRENADE, 5)
  150.    cs_set_user_bpammo(id, CSW_FLASHBANG, 5)
  151.    cs_set_user_nvg(id, 1)
  152.    client_print(id, print_chat,"[BIO] Universal Soldier (Admin Class)");
  153.   }
  154.  }
  155.  menu_destroy(menu)
  156.  return PLUGIN_HANDLED
  157. }
  158. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  159. *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang9242\\ f0\\ fs16 \n\\ par }
  160. */
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top