Exclude armor for non vips
Exclude armor for non vips
Can anybody make a plugin which doesnt allow normal humans(non-VIPS) to not pickup armor?
LOL
ze_block_events_messages.sma:
- #include <zombie_escape>
- #include <ze_vip>
- // Defines
- #define HUD_MONEY (1<<5)
- #define HUD_RADAR_HEALTH_ARMOR (1<<3)
- // Variables
- new g_iFwSpawn
- // Cvars
- new g_pCvarBlockKillCmd,
- g_pCvarBlockMoneyHUD,
- g_pCvarBlockOtherHUD
- public plugin_init()
- {
- register_plugin("[ZE] Blocked Messages & Events", ZE_VERSION, AUTHORS)
- // Block some messages
- register_message(get_user_msgid("TextMsg"), "Message_TextMsg")
- register_message(get_user_msgid("SendAudio"), "Message_SendAudio")
- register_message(get_user_msgid("StatusIcon"), "Message_StatusIcon")
- register_message(get_user_msgid("HideWeapon"), "Message_HideWeapon")
- // Fakemeta
- register_forward(FM_ClientKill, "Fw_ClientKill_Pre", 0)
- unregister_forward(FM_Spawn, g_iFwSpawn)
- // Hams
- RegisterHam(Ham_Touch, "weaponbox", "Fw_TouchWeaponBox_Pre", 0)
- RegisterHam(Ham_Touch, "armoury_entity", "Fw_TouchWeaponBox_Pre", 0)
- // Cvars
- g_pCvarBlockKillCmd = register_cvar("ze_block_kill", "1")
- g_pCvarBlockMoneyHUD = register_cvar("ze_block_money_hud", "1")
- g_pCvarBlockOtherHUD = register_cvar("ze_block_radar_ap_hp", "1")
- }
- public plugin_precache()
- {
- // Prevent Entities from being spawned like (Rain, Snow, Fog) It's registered here as this called before plugin_init()
- g_iFwSpawn = register_forward(FM_Spawn, "Fw_Spawn")
- }
- public Message_TextMsg()
- {
- new szMsg[22]
- get_msg_arg_string(2, szMsg, charsmax(szMsg))
- // Block round end related messages
- 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"))
- return PLUGIN_HANDLED
- return PLUGIN_CONTINUE
- }
- public Message_SendAudio()
- {
- new szAudio[17]
- get_msg_arg_string(2, szAudio, charsmax(szAudio))
- // Block CS round win audio messages
- if (equal(szAudio[7], "terwin") || equal(szAudio[7], "ctwin") || equal(szAudio[7], "rounddraw"))
- return PLUGIN_HANDLED
- return PLUGIN_CONTINUE
- }
- public Message_StatusIcon(Index, Dest, iEnt)
- {
- static szMsg[8]
- get_msg_arg_string(2, szMsg ,charsmax(szMsg))
- // Block Buyzone
- if (equal(szMsg, "buyzone") && get_msg_arg_int(1))
- {
- set_pdata_int(iEnt, 235, get_pdata_int(iEnt, 235) & ~(1<<0))
- return PLUGIN_HANDLED
- }
- return PLUGIN_CONTINUE
- }
- public Message_HideWeapon(Index, Dest, iEnt)
- {
- if (get_pcvar_num(g_pCvarBlockMoneyHUD))
- {
- set_msg_arg_int(1, ARG_BYTE, get_msg_arg_int(1) | HUD_MONEY)
- }
- if (get_pcvar_num(g_pCvarBlockOtherHUD))
- {
- set_msg_arg_int(1, ARG_BYTE, get_msg_arg_int(1) | HUD_RADAR_HEALTH_ARMOR)
- }
- }
- public Fw_ClientKill_Pre(id)
- {
- // Block Kill Command if enabled
- if (get_pcvar_num(g_pCvarBlockKillCmd))
- return FMRES_SUPERCEDE
- return PLUGIN_CONTINUE
- }
- public Fw_Spawn(iEnt)
- {
- // Invalid entity
- if (!pev_valid(iEnt))
- return FMRES_IGNORED
- // Get classname
- new szClassName[32]
- get_entvar(iEnt, var_classname, szClassName, charsmax(szClassName))
- // Prevent All (Rain, Snow, Fog) From the original map, So we can add our Weather
- if (equal(szClassName, "env_rain") || equal(szClassName, "env_snow") || equal(szClassName, "env_fog"))
- {
- engfunc(EngFunc_RemoveEntity, iEnt)
- return FMRES_SUPERCEDE
- }
- return FMRES_IGNORED
- }
- public Fw_TouchWeaponBox_Pre(iWeapon, iIndex)
- {
- if (!is_user_alive(iIndex))
- return HAM_IGNORED
- if (!ze_is_user_vip(iIndex) && get_member(iWeapon, m_Armoury_iItem) == ARMOURY_KEVLAR)
- return HAM_SUPERCEDE
- // Block Zombies From Pick UP Weapons
- if (ze_is_user_zombie(iIndex))
- return HAM_SUPERCEDE
- return HAM_IGNORED
- }
He who fails to plan is planning to fail
Make sure to use latest ze_vip.inc (api/ze_vip)
He who fails to plan is planning to fail
Working for me, which version of VIP system you are using?
He who fails to plan is planning to fail
can u make it like the plugin reads vip flags like admin_model_access without using the vip includes
LOL
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
- #include <zombie_escape>
- #include <ze_vip>
- // Defines
- #define HUD_MONEY (1<<5)
- #define HUD_RADAR_HEALTH_ARMOR (1<<3)
- #define ACCESS VIP_H
- // Variables
- new g_iFwSpawn
- // Cvars
- new g_pCvarBlockKillCmd,
- g_pCvarBlockMoneyHUD,
- g_pCvarBlockOtherHUD
- public plugin_init()
- {
- register_plugin("[ZE] Blocked Messages & Events", ZE_VERSION, AUTHORS)
- // Block some messages
- register_message(get_user_msgid("TextMsg"), "Message_TextMsg")
- register_message(get_user_msgid("SendAudio"), "Message_SendAudio")
- register_message(get_user_msgid("StatusIcon"), "Message_StatusIcon")
- register_message(get_user_msgid("HideWeapon"), "Message_HideWeapon")
- // Fakemeta
- register_forward(FM_ClientKill, "Fw_ClientKill_Pre", 0)
- unregister_forward(FM_Spawn, g_iFwSpawn)
- // Hams
- RegisterHam(Ham_Touch, "weaponbox", "Fw_TouchWeaponBox_Pre", 0)
- RegisterHam(Ham_Touch, "armoury_entity", "Fw_TouchWeaponBox_Pre", 0)
- // Cvars
- g_pCvarBlockKillCmd = register_cvar("ze_block_kill", "1")
- g_pCvarBlockMoneyHUD = register_cvar("ze_block_money_hud", "1")
- g_pCvarBlockOtherHUD = register_cvar("ze_block_radar_ap_hp", "1")
- }
- public plugin_precache()
- {
- // Prevent Entities from being spawned like (Rain, Snow, Fog) It's registered here as this called before plugin_init()
- g_iFwSpawn = register_forward(FM_Spawn, "Fw_Spawn")
- }
- public Message_TextMsg()
- {
- new szMsg[22]
- get_msg_arg_string(2, szMsg, charsmax(szMsg))
- // Block round end related messages
- 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"))
- return PLUGIN_HANDLED
- return PLUGIN_CONTINUE
- }
- public Message_SendAudio()
- {
- new szAudio[17]
- get_msg_arg_string(2, szAudio, charsmax(szAudio))
- // Block CS round win audio messages
- if (equal(szAudio[7], "terwin") || equal(szAudio[7], "ctwin") || equal(szAudio[7], "rounddraw"))
- return PLUGIN_HANDLED
- return PLUGIN_CONTINUE
- }
- public Message_StatusIcon(Index, Dest, iEnt)
- {
- static szMsg[8]
- get_msg_arg_string(2, szMsg ,charsmax(szMsg))
- // Block Buyzone
- if (equal(szMsg, "buyzone") && get_msg_arg_int(1))
- {
- set_pdata_int(iEnt, 235, get_pdata_int(iEnt, 235) & ~(1<<0))
- return PLUGIN_HANDLED
- }
- return PLUGIN_CONTINUE
- }
- public Message_HideWeapon(Index, Dest, iEnt)
- {
- if (get_pcvar_num(g_pCvarBlockMoneyHUD))
- {
- set_msg_arg_int(1, ARG_BYTE, get_msg_arg_int(1) | HUD_MONEY)
- }
- if (get_pcvar_num(g_pCvarBlockOtherHUD))
- {
- set_msg_arg_int(1, ARG_BYTE, get_msg_arg_int(1) | HUD_RADAR_HEALTH_ARMOR)
- }
- }
- public Fw_ClientKill_Pre(id)
- {
- // Block Kill Command if enabled
- if (get_pcvar_num(g_pCvarBlockKillCmd))
- return FMRES_SUPERCEDE
- return PLUGIN_CONTINUE
- }
- public Fw_Spawn(iEnt)
- {
- // Invalid entity
- if (!pev_valid(iEnt))
- return FMRES_IGNORED
- // Get classname
- new szClassName[32]
- get_entvar(iEnt, var_classname, szClassName, charsmax(szClassName))
- // Prevent All (Rain, Snow, Fog) From the original map, So we can add our Weather
- if (equal(szClassName, "env_rain") || equal(szClassName, "env_snow") || equal(szClassName, "env_fog"))
- {
- engfunc(EngFunc_RemoveEntity, iEnt)
- return FMRES_SUPERCEDE
- }
- return FMRES_IGNORED
- }
- public Fw_TouchWeaponBox_Pre(iWeapon, iIndex)
- {
- if (!is_user_alive(iIndex))
- return HAM_IGNORED
- if (!(ze_get_vip_flags(iIndex) & ACCESS) && (get_member(iWeapon, m_Armoury_iItem) == ARMOURY_KEVLAR))
- return HAM_SUPERCEDE
- // Block Zombies From Pick UP Weapons
- if (ze_is_user_zombie(iIndex))
- return HAM_SUPERCEDE
- return HAM_IGNORED
- }
He who fails to plan is planning to fail
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
Sign in
Who is online
Users browsing this forum: No registered users and 0 guests