Re: [ReQ] New Idea (Armor)
Posted: 15 Aug 2018, 19:05
can someone make it working for VIPS only? Because all players have this ARMOR
Zombie Escape Mod for Counter-Strike 1.6
https://escapers-zone.net/
czirimbolo wrote: ↑5 years ago can someone make it working for VIPS only? Because all players have this ARMOR
Code: Select all
#include <ze_vip>
// Sound
new const g_szArmorSound[] = "player/bhit_helmet-1.wav"
// Cvars
new g_pCvarArmorAmount
public plugin_init()
{
register_plugin("[ZE] Armor","1.0","Raheem")
// Cvars
g_pCvarArmorAmount = register_cvar("ze_human_armor_amount", "100")
}
public ze_user_humanized(id)
{
set_entvar(id, var_armorvalue, get_pcvar_float(g_pCvarArmorAmount))
}
public ze_user_infected_pre(iVictim, iInfector, iDamage)
{
if (!(ze_get_vip_flags(id) & VIP_A))
return HC_CONTINUE;
if (iInfector != 0)
{
new iArmor = floatround(get_entvar(iVictim, var_armorvalue))
if (iArmor > 0)
{
emit_sound(iVictim, CHAN_BODY, g_szArmorSound, 1.0, ATTN_NORM, 0, PITCH_NORM)
if (iArmor - iDamage > 0)
{
set_entvar(iVictim, var_armorvalue, float(iArmor - iDamage))
}
else
{
set_entvar(iVictim, var_armorvalue, 0.0)
}
return HC_SUPERCEDE;
}
}
return HC_CONTINUE;
}
Code: Select all
#include <zombie_escape>
#include <ze_vip>
// Sound
new const g_szArmorSound[] = "player/bhit_helmet-1.wav"
// Cvars
new g_pCvarArmorAmount
public plugin_init()
{
register_plugin("[ZE] Armor","1.0","Raheem")
// Cvars
g_pCvarArmorAmount = register_cvar("ze_human_armor_amount", "100")
}
public ze_user_humanized(id)
{
if (ze_get_vip_flags(id) & VIP_A)
{
set_entvar(id, var_armorvalue, get_pcvar_float(g_pCvarArmorAmount))
}
}
public ze_user_infected_pre(iVictim, iInfector, iDamage)
{
if (!(ze_get_vip_flags(iVictim) & VIP_A))
return HC_CONTINUE
if (iInfector != 0)
{
new iArmor = floatround(get_entvar(iVictim, var_armorvalue))
if (iArmor > 0)
{
emit_sound(iVictim, CHAN_BODY, g_szArmorSound, 1.0, ATTN_NORM, 0, PITCH_NORM)
if (iArmor - iDamage > 0)
{
set_entvar(iVictim, var_armorvalue, float(iArmor - iDamage))
}
else
{
set_entvar(iVictim, var_armorvalue, 0.0)
}
return HC_SUPERCEDE
}
}
return HC_CONTINUE
}
Check the updated code.czirimbolo wrote: ↑5 years ago I added #include <zombie_escape> but:
/ C:\Users\macie\Desktop\Compiler v1.8.3\scripting\ze_armor.sma(28) : error 017: undefined symbol "id"
//
// 1 Error.
// Could not locate output file compiled\ze_armor.amx (compile failed).
//
// Compilation Time: 0,84 sec
Do you have the required flags?DeVil_Raghav wrote: ↑3 years ago Hi guys, this plugin is not working with my sv, still get infected by 1 hit
Yes I haveMohamed Alaa wrote: ↑3 years agoDo you have the required flags?DeVil_Raghav wrote: ↑3 years ago Hi guys, this plugin is not working with my sv, still get infected by 1 hit
hello, I have tried installing new version but still get infected with one hit what should I do?
No Need Flag of VIP, in Zombie Plaguue or Zombie Escape v2.7 any player can pickup Kevlar + Helmet but when zombie damage player (damage is default of knife)Mohamed Alaa wrote: ↑3 years ago Just make sure you have the required flags cause it's working fine for me and everyone else using it I think.
If you can, post any errors.
it's work very good !DeVil_Raghav wrote: ↑3 years agohello, I have tried installing new version but still get infected with one hit what should I do?
code I use =
#include <zombie_escape> #include <ze_vip> // Sound new const g_szArmorSound[] = "player/bhit_helmet-1.wav" // Cvars new g_pCvarArmorAmount public plugin_init() { register_plugin("[ZE] Armor","1.0","Raheem") // Cvars g_pCvarArmorAmount = register_cvar("ze_human_armor_amount", "100") } public ze_user_humanized(id) { set_entvar(id, var_armorvalue, get_pcvar_float(g_pCvarArmorAmount)) } public ze_user_infected_pre(iVictim, iInfector, iDamage) { if (!(ze_get_vip_flags(id) & VIP_A)) return HC_CONTINUE; if (iInfector != 0) { new iArmor = floatround(get_entvar(iVictim, var_armorvalue)) if (iArmor > 0) { emit_sound(iVictim, CHAN_BODY, g_szArmorSound, 1.0, ATTN_NORM, 0, PITCH_NORM) if (iArmor - iDamage > 0) { set_entvar(iVictim, var_armorvalue, float(iArmor - iDamage)) } else { set_entvar(iVictim, var_armorvalue, 0.0) } return HC_SUPERCEDE; } } return HC_CONTINUE; }