Available Exclude armor for non vips

Unpaid Requests, Public Plugins
Post Reply
Rain1153
Senior Member
Senior Member
India
Posts: 278
Joined: 6 years ago
Contact:

Exclude armor for non vips

#1

Post by Rain1153 » 5 years ago

Can anybody make a plugin which doesnt allow normal humans(non-VIPS) to not pickup armor?
LOL

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#2

Post by Raheem » 5 years ago

ze_block_events_messages.sma:

  1. #include <zombie_escape>
  2. #include <ze_vip>
  3.  
  4. // Defines
  5. #define HUD_MONEY               (1<<5)
  6. #define HUD_RADAR_HEALTH_ARMOR  (1<<3)
  7.  
  8. // Variables
  9. new g_iFwSpawn
  10.  
  11. // Cvars
  12. new g_pCvarBlockKillCmd,
  13.     g_pCvarBlockMoneyHUD,
  14.     g_pCvarBlockOtherHUD
  15.  
  16. public plugin_init()
  17. {
  18.     register_plugin("[ZE] Blocked Messages & Events", ZE_VERSION, AUTHORS)
  19.    
  20.     // Block some messages
  21.     register_message(get_user_msgid("TextMsg"), "Message_TextMsg")
  22.     register_message(get_user_msgid("SendAudio"), "Message_SendAudio")
  23.     register_message(get_user_msgid("StatusIcon"), "Message_StatusIcon")
  24.     register_message(get_user_msgid("HideWeapon"), "Message_HideWeapon")
  25.    
  26.     // Fakemeta
  27.     register_forward(FM_ClientKill, "Fw_ClientKill_Pre", 0)
  28.     unregister_forward(FM_Spawn, g_iFwSpawn)
  29.    
  30.     // Hams
  31.     RegisterHam(Ham_Touch, "weaponbox", "Fw_TouchWeaponBox_Pre", 0)
  32.     RegisterHam(Ham_Touch, "armoury_entity", "Fw_TouchWeaponBox_Pre", 0)
  33.    
  34.     // Cvars
  35.     g_pCvarBlockKillCmd = register_cvar("ze_block_kill", "1")
  36.     g_pCvarBlockMoneyHUD = register_cvar("ze_block_money_hud", "1")
  37.     g_pCvarBlockOtherHUD = register_cvar("ze_block_radar_ap_hp", "1")
  38. }
  39.  
  40. public plugin_precache()
  41. {
  42.     // Prevent Entities from being spawned like (Rain, Snow, Fog) It's registered here as this called before plugin_init()
  43.     g_iFwSpawn = register_forward(FM_Spawn, "Fw_Spawn")
  44. }
  45.  
  46. public Message_TextMsg()
  47. {
  48.     new szMsg[22]
  49.     get_msg_arg_string(2, szMsg, charsmax(szMsg))
  50.    
  51.     // Block round end related messages
  52.     if (equal(szMsg, "#Hostages_Not_Rescued") || equal(szMsg, "#Round_Draw") || equal(szMsg, "#CTs_Win") || equal(szMsg, "#Terrorists_Win") || equal(szMsg, "#Game_will_restart_in") || equal(szMsg, "#Game_Commencing"))
  53.         return PLUGIN_HANDLED
  54.    
  55.     return PLUGIN_CONTINUE
  56. }
  57.  
  58. public Message_SendAudio()
  59. {
  60.     new szAudio[17]
  61.     get_msg_arg_string(2, szAudio, charsmax(szAudio))
  62.    
  63.     // Block CS round win audio messages
  64.     if (equal(szAudio[7], "terwin") || equal(szAudio[7], "ctwin") || equal(szAudio[7], "rounddraw"))
  65.         return PLUGIN_HANDLED
  66.    
  67.     return PLUGIN_CONTINUE
  68. }
  69.  
  70. public Message_StatusIcon(Index, Dest, iEnt)
  71. {
  72.     static szMsg[8]
  73.     get_msg_arg_string(2, szMsg ,charsmax(szMsg))
  74.    
  75.     // Block Buyzone
  76.     if (equal(szMsg, "buyzone") && get_msg_arg_int(1))
  77.     {
  78.         set_pdata_int(iEnt, 235, get_pdata_int(iEnt, 235) & ~(1<<0))
  79.         return PLUGIN_HANDLED
  80.     }
  81.    
  82.     return PLUGIN_CONTINUE
  83. }
  84.  
  85. public Message_HideWeapon(Index, Dest, iEnt)
  86. {
  87.     if (get_pcvar_num(g_pCvarBlockMoneyHUD))
  88.     {
  89.         set_msg_arg_int(1, ARG_BYTE, get_msg_arg_int(1) | HUD_MONEY)
  90.     }
  91.    
  92.     if (get_pcvar_num(g_pCvarBlockOtherHUD))
  93.     {
  94.         set_msg_arg_int(1, ARG_BYTE, get_msg_arg_int(1) | HUD_RADAR_HEALTH_ARMOR)
  95.     }
  96. }
  97.  
  98. public Fw_ClientKill_Pre(id)
  99. {
  100.     // Block Kill Command if enabled
  101.     if (get_pcvar_num(g_pCvarBlockKillCmd))
  102.         return FMRES_SUPERCEDE
  103.    
  104.     return PLUGIN_CONTINUE
  105. }
  106.  
  107. public Fw_Spawn(iEnt)
  108. {
  109.     // Invalid entity
  110.     if (!pev_valid(iEnt))
  111.         return FMRES_IGNORED
  112.    
  113.     // Get classname
  114.     new szClassName[32]
  115.     get_entvar(iEnt, var_classname, szClassName, charsmax(szClassName))
  116.    
  117.     // Prevent All (Rain, Snow, Fog) From the original map, So we can add our Weather
  118.     if (equal(szClassName, "env_rain") || equal(szClassName, "env_snow") || equal(szClassName, "env_fog"))
  119.     {
  120.         engfunc(EngFunc_RemoveEntity, iEnt)
  121.         return FMRES_SUPERCEDE
  122.     }
  123.    
  124.     return FMRES_IGNORED
  125. }
  126.  
  127. public Fw_TouchWeaponBox_Pre(iWeapon, iIndex)
  128. {
  129.     if (!is_user_alive(iIndex))
  130.         return HAM_IGNORED
  131.    
  132.     if (!ze_is_user_vip(iIndex) && get_member(iWeapon, m_Armoury_iItem) == ARMOURY_KEVLAR)
  133.         return HAM_SUPERCEDE
  134.    
  135.     // Block Zombies From Pick UP Weapons
  136.     if (ze_is_user_zombie(iIndex))
  137.         return HAM_SUPERCEDE
  138.    
  139.     return HAM_IGNORED
  140. }
He who fails to plan is planning to fail

Rain1153
Senior Member
Senior Member
India
Posts: 278
Joined: 6 years ago
Contact:

#3

Post by Rain1153 » 5 years ago

error undefined symbol ze_is_user_vip
LOL

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#4

Post by Raheem » 5 years ago

Make sure to use latest ze_vip.inc (api/ze_vip)
He who fails to plan is planning to fail

Rain1153
Senior Member
Senior Member
India
Posts: 278
Joined: 6 years ago
Contact:

#5

Post by Rain1153 » 5 years ago

now zm pciks up guns and infects humans lmao
LOL

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#6

Post by Raheem » 5 years ago

Working for me, which version of VIP system you are using?
He who fails to plan is planning to fail

Rain1153
Senior Member
Senior Member
India
Posts: 278
Joined: 6 years ago
Contact:

#7

Post by Rain1153 » 5 years ago

the recent one not new one
LOL

Rain1153
Senior Member
Senior Member
India
Posts: 278
Joined: 6 years ago
Contact:

#8

Post by Rain1153 » 5 years ago

can u make it like the plugin reads vip flags like admin_model_access without using the vip includes
LOL

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#9

Post by Raheem » 5 years ago

ze_is_user_vip() function exists only in latest version of vip system.

Yes we can use the normal method that exists in ur version on specific flag, but why not to use latest version?
He who fails to plan is planning to fail

Rain1153
Senior Member
Senior Member
India
Posts: 278
Joined: 6 years ago
Contact:

#10

Post by Rain1153 » 5 years ago

i have plugins which are based on the last version thats why
LOL

Rain1153
Senior Member
Senior Member
India
Posts: 278
Joined: 6 years ago
Contact:

#11

Post by Rain1153 » 5 years ago

i will update it soon..but for now i hope u help :D
LOL

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#12

Post by Raheem » 5 years ago

  1. #include <zombie_escape>
  2. #include <ze_vip>
  3.  
  4. // Defines
  5. #define HUD_MONEY               (1<<5)
  6. #define HUD_RADAR_HEALTH_ARMOR  (1<<3)
  7. #define ACCESS VIP_H
  8.  
  9. // Variables
  10. new g_iFwSpawn
  11.  
  12. // Cvars
  13. new g_pCvarBlockKillCmd,
  14.     g_pCvarBlockMoneyHUD,
  15.     g_pCvarBlockOtherHUD
  16.  
  17. public plugin_init()
  18. {
  19.     register_plugin("[ZE] Blocked Messages & Events", ZE_VERSION, AUTHORS)
  20.    
  21.     // Block some messages
  22.     register_message(get_user_msgid("TextMsg"), "Message_TextMsg")
  23.     register_message(get_user_msgid("SendAudio"), "Message_SendAudio")
  24.     register_message(get_user_msgid("StatusIcon"), "Message_StatusIcon")
  25.     register_message(get_user_msgid("HideWeapon"), "Message_HideWeapon")
  26.    
  27.     // Fakemeta
  28.     register_forward(FM_ClientKill, "Fw_ClientKill_Pre", 0)
  29.     unregister_forward(FM_Spawn, g_iFwSpawn)
  30.    
  31.     // Hams
  32.     RegisterHam(Ham_Touch, "weaponbox", "Fw_TouchWeaponBox_Pre", 0)
  33.     RegisterHam(Ham_Touch, "armoury_entity", "Fw_TouchWeaponBox_Pre", 0)
  34.    
  35.     // Cvars
  36.     g_pCvarBlockKillCmd = register_cvar("ze_block_kill", "1")
  37.     g_pCvarBlockMoneyHUD = register_cvar("ze_block_money_hud", "1")
  38.     g_pCvarBlockOtherHUD = register_cvar("ze_block_radar_ap_hp", "1")
  39. }
  40.  
  41. public plugin_precache()
  42. {
  43.     // Prevent Entities from being spawned like (Rain, Snow, Fog) It's registered here as this called before plugin_init()
  44.     g_iFwSpawn = register_forward(FM_Spawn, "Fw_Spawn")
  45. }
  46.  
  47. public Message_TextMsg()
  48. {
  49.     new szMsg[22]
  50.     get_msg_arg_string(2, szMsg, charsmax(szMsg))
  51.    
  52.     // Block round end related messages
  53.     if (equal(szMsg, "#Hostages_Not_Rescued") || equal(szMsg, "#Round_Draw") || equal(szMsg, "#CTs_Win") || equal(szMsg, "#Terrorists_Win") || equal(szMsg, "#Game_will_restart_in") || equal(szMsg, "#Game_Commencing"))
  54.         return PLUGIN_HANDLED
  55.    
  56.     return PLUGIN_CONTINUE
  57. }
  58.  
  59. public Message_SendAudio()
  60. {
  61.     new szAudio[17]
  62.     get_msg_arg_string(2, szAudio, charsmax(szAudio))
  63.    
  64.     // Block CS round win audio messages
  65.     if (equal(szAudio[7], "terwin") || equal(szAudio[7], "ctwin") || equal(szAudio[7], "rounddraw"))
  66.         return PLUGIN_HANDLED
  67.    
  68.     return PLUGIN_CONTINUE
  69. }
  70.  
  71. public Message_StatusIcon(Index, Dest, iEnt)
  72. {
  73.     static szMsg[8]
  74.     get_msg_arg_string(2, szMsg ,charsmax(szMsg))
  75.    
  76.     // Block Buyzone
  77.     if (equal(szMsg, "buyzone") && get_msg_arg_int(1))
  78.     {
  79.         set_pdata_int(iEnt, 235, get_pdata_int(iEnt, 235) & ~(1<<0))
  80.         return PLUGIN_HANDLED
  81.     }
  82.    
  83.     return PLUGIN_CONTINUE
  84. }
  85.  
  86. public Message_HideWeapon(Index, Dest, iEnt)
  87. {
  88.     if (get_pcvar_num(g_pCvarBlockMoneyHUD))
  89.     {
  90.         set_msg_arg_int(1, ARG_BYTE, get_msg_arg_int(1) | HUD_MONEY)
  91.     }
  92.    
  93.     if (get_pcvar_num(g_pCvarBlockOtherHUD))
  94.     {
  95.         set_msg_arg_int(1, ARG_BYTE, get_msg_arg_int(1) | HUD_RADAR_HEALTH_ARMOR)
  96.     }
  97. }
  98.  
  99. public Fw_ClientKill_Pre(id)
  100. {
  101.     // Block Kill Command if enabled
  102.     if (get_pcvar_num(g_pCvarBlockKillCmd))
  103.         return FMRES_SUPERCEDE
  104.    
  105.     return PLUGIN_CONTINUE
  106. }
  107.  
  108. public Fw_Spawn(iEnt)
  109. {
  110.     // Invalid entity
  111.     if (!pev_valid(iEnt))
  112.         return FMRES_IGNORED
  113.    
  114.     // Get classname
  115.     new szClassName[32]
  116.     get_entvar(iEnt, var_classname, szClassName, charsmax(szClassName))
  117.    
  118.     // Prevent All (Rain, Snow, Fog) From the original map, So we can add our Weather
  119.     if (equal(szClassName, "env_rain") || equal(szClassName, "env_snow") || equal(szClassName, "env_fog"))
  120.     {
  121.         engfunc(EngFunc_RemoveEntity, iEnt)
  122.         return FMRES_SUPERCEDE
  123.     }
  124.    
  125.     return FMRES_IGNORED
  126. }
  127.  
  128. public Fw_TouchWeaponBox_Pre(iWeapon, iIndex)
  129. {
  130.     if (!is_user_alive(iIndex))
  131.         return HAM_IGNORED
  132.    
  133.     if (!(ze_get_vip_flags(iIndex) & ACCESS) && (get_member(iWeapon, m_Armoury_iItem) == ARMOURY_KEVLAR))
  134.         return HAM_SUPERCEDE
  135.    
  136.     // Block Zombies From Pick UP Weapons
  137.     if (ze_is_user_zombie(iIndex))
  138.         return HAM_SUPERCEDE
  139.    
  140.     return HAM_IGNORED
  141. }
He who fails to plan is planning to fail

Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Who is online

Users browsing this forum: No registered users and 0 guests