Hello, this ghost zombie class can be changed so its ability to be used only for 50 seconds after the 50 seconds expires to wait for another 30 seconds before it can use its ability again.
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <fun>
#include <zombie_plague_special>
#include <zombiexp>
#define flag_get(%1,%2) (%1 & (1 << (%2 & 31)))
#define flag_get_boolean(%1,%2) (flag_get(%1,%2) ? true : false)
#define flag_set(%1,%2) %1 |= (1 << (%2 & 31))
#define flag_unset(%1,%2) %1 &= ~(1 << (%2 & 31))
new const zclass_name[] = { "NoCip Zombie" }
new const zclass_info[] = { "Move Anywhere" }
new const zclass_model[] = { "zombie_source" }
new const zclass_clawmodel[] = { "v_knife_zombie.mdl" }
const zclass_health = 1
const zclass_speed = 190
const Float:zclass_gravity = 1.0
const Float:zclass_knockback = 1.0
const zclass_level = 19
new g_IdClass, g_IsNoClipZm
public plugin_precache()
{
g_IdClass = zpxp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback, zclass_level)
}
public plugin_init()
{
RegisterHam(Ham_Spawn, "player", "PlayerSpawnPost", 1)
}
public client_putinserver(id)
{
flag_unset(g_IsNoClipZm,id)
}
public client_disconnect(id)
{
flag_unset(g_IsNoClipZm,id)
}
public PlayerSpawnPost(id)
{
if(!is_user_alive(id)) return;
flag_unset(g_IsNoClipZm,id)
if(get_user_noclip(id)) set_user_noclip(id);
}
public zp_user_infected_post(id, infector)
{
if(zp_get_user_nemesis(id)) return;
if(zp_get_user_zombie_class(id) == g_IdClass)
{
client_print(id, print_chat, "[FANTOMA] Ai Clasa Fantoma poti trece cu usurinta prin ziduri.")
flag_set(g_IsNoClipZm,id)
set_user_noclip(id, 1)
}
}
public zp_user_humanized_post(id)
{
if(flag_get(g_IsNoClipZm,id))
{
flag_unset(g_IsNoClipZm,id)
set_user_noclip(id)
}
}