Can anyone help me with this?
Can help me add this? :
Press E to be invisible , cooldown and how long will be the cooldown. I keep trying but it fail.
Here my code:
PHP Code:
/*================================================================================
-----------------------------------
-*- [ZP] Class : Invisible Zombie -*-
-----------------------------------
~~~~~~~~~~~~~~~
- Description -
~~~~~~~~~~~~~~~
Press the key [E] to be Invisible.
================================================================================*/
#include <zombieplague>
#include <amxmodx>
#include <fakemeta>
#define PLUGIN "[ZP] Zombie Classes : Invisible Zombie"
#define VERSION "1.0"
#define AUTHOR "zombieplague"
new g_zclass_izombie, g_invisible_amount
new const zclass_name[] = { "Invisible Zombie" }
new const zclass_info[] = { "Invisible" }
new const zclass_model[] = { "zombie_source" }
new const zclass_clawmodel[] = { "v_knife_zombie.mdl" }
const zclass_health = 1500
const zclass_speed = 250
const Float:zclass_gravity = 1.0
const Float:zclass_knockback = 1.0
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
g_invisible_amount = register_cvar("zp_izombie_invisibility", "100")
register_forward(FM_AddToFullPack,"fw_addtofullpack",1)
}
public plugin_precache()
{
g_zclass_izombie = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)
}
public zp_user_infected_post(player, infector)
{
if (zp_get_user_zombie_class(player) == g_zclass_izombie)
{
client_print(player, print_chat, "[ZP] To be Invisible press the key [E].")
}
}
public fw_addtofullpack(es_handle,e,ent,host,hostflags,player,pSet)
{
if(!is_user_alive(ent) || !is_user_alive(host))
return FMRES_IGNORED
if(zp_get_user_zombie(ent) && zp_get_user_zombie_class(ent) == g_zclass_izombie)
{
set_es(es_handle, ES_RenderMode, kRenderTransAlpha)
set_es(es_handle, ES_RenderAmt, get_pcvar_num(g_invisible_amount))
}
return FMRES_IGNORED
}
stock fm_set_rendering(entity, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 255)
{
set_pev(entity, pev_renderfx, fx)
set_pev(entity, pev_rendercolor, RenderColor)
set_pev(entity, pev_rendermode, render)
set_pev(entity, pev_renderamt, float(amount))
return 1
}
Here the example :
http://www.youtube.com/watch?v=Yu3WOjpYgoM