HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. /* Plugin generated by AMXX-Studio */
  2.  
  3. #include < amxmodx >
  4.  
  5. #include < zombieplague >
  6. #include < engine >
  7.  
  8. #define PLUGIN "Hat"
  9. #define VERSION "1.0"
  10. #define AUTHOR "pRoxxx"
  11.  
  12. new Ent[33]
  13. new const g_model[] =
  14. {
  15. "Ut a modelnek pl: models/kalap.mdl"
  16. }
  17.  
  18. public plugin_init()
  19. {
  20. register_plugin(PLUGIN, VERSION, AUTHOR)
  21.  
  22. register_event("Battery", "armor", "be")
  23. }
  24.  
  25. public plugin_precache()
  26. {
  27. precache_model( g_model )
  28. }
  29.  
  30. public armor(id)
  31. {
  32. new arm = read_data(1)
  33.  
  34. if(zp_get_user_zombie(id))
  35. {
  36. remove_hat(id)
  37. return
  38. }
  39.  
  40. if(arm < 1)
  41. {
  42. if(Ent[id] > 0)
  43. {
  44. remove_hat(id)
  45. }
  46. }
  47. else if(arm > 0)
  48. {
  49. if(Ent[id] < 1)
  50. {
  51. Ent[id] = create_entity("info_target")
  52. if(is_valid_ent(id))
  53. {
  54. entity_set_model(Ent[id] , g_model)
  55. entity_set_int(Ent[id], EV_INT_movetype, MOVETYPE_FOLLOW)
  56. entity_set_edict(Ent[id], EV_ENT_aiment, id)
  57. }
  58. }
  59. }
  60. }
  61.  
  62. public remove_hat(id)
  63. {
  64. if(Ent[id] > 0)
  65. {
  66. remove_entity(Ent[id])
  67. Ent[id] = 0
  68. }
  69. }
  70.  
  71. public client_connect(id)
  72. {
  73. remove_hat(id)
  74. }
  75.  
  76. public client_disconnect(id)
  77. {
  78. remove_hat(id)
  79. }
  80.