Here..
PHP Code:
/* ===========================================================================
/
/
/ [ZP] Class : Noclip Zombie
/ ( Powerful zombie class )
/ by Fry
/
/
/
/ Description :
/
/ Another zombie class are made, but this zombie can walk through walls every time you want, something similar to Ghost Zombie.
/ How to use noclip? It's easy just bind [key] +noclip. There is small amount of time given to you before noclip will end, however you can change cooldown and noclip by CVARS.
/
/ Note :
/
/ If You want to use this zombie class for admins only just uncomment //#define FOR_ADMINS
/ Class only available for flag A admins.
/
/
/
/ Cvars :
/
/ zp_noclip_cooldown "10.0" - How long cooldown you will need to wait to use it again.
/ zp_noclip_long "15.0" - How long you can use noclip before cooldown.
/
/
/
/ Credits :
/
/ GHW_Chronic - for his Toggleable Noclip plugin
/
/
/
/ Changelog :
/
/ 09/11/2008 - v1.0 - First release
/ 09/11/2008 - v1.0.1 - added command to turn noclip off.
/ 09/11/2008 - v1.2 - fixed that noclip was working without pressing binded key, added cooldown, added how long you can walk through walls.
/ 01/01/2009 - v1.2.4 - removed fun module, added cvar, corrected code, added possibility if class want to use admins only.
/
/
*/
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <zombieplague>
#define PLUGIN "[ZP] Class : Noclip Zombie"
#define VERSION "1.2.4"
#define AUTHOR "The_Thing aka Fry"
//#define FOR_ADMINS
#if defined FOR_ADMINS
#define ADMINACCESS ADMIN_LEVEL_A
#endif
new const zclass10_name[] = { "Noclip Zombie" }
new const zclass10_info[] = { "HP-- Speed+++ Knockback++" }
new const zclass10_model[] = { "zombie_source" }
new const zclass10_clawmodel[] = { "v_knife_zombie.mdl" }
const zclass10_health = 1500
const zclass10_speed = 270
const Float:zclass10_gravity = 1.0
const Float:zclass10_knockback = 1.50
new g_zclass10_noclip, g_zclass_noclip_cooldown, g_zclass_noclip_long
new Float:g_zclass_noclip_time[33]
new bool:g_hasNoclip[33]
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_cvar("zp_zclass_noclip_zombie",VERSION,FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_UNLOGGED|FCVAR_SPONLY)
register_concmd("+noclip","cmd_noclip", ADMIN_USER, "bind [key] +noclip")
register_clcmd("-noclip","cmd_off")
g_zclass_noclip_cooldown = register_cvar("zp_noclip_cooldown", "10.0")
g_zclass_noclip_long = register_cvar("zp_noclip_long", "15.0")
}
public plugin_precache()
{
g_zclass10_noclip = zp_register_zombie_class(zclass10_name, zclass10_info, zclass10_model, zclass10_clawmodel, zclass10_health, zclass10_speed, zclass10_gravity, zclass10_knockback)
}
public zp_user_infected_post(player, infector)
{
if (zp_get_user_zombie_class(player) == g_zclass10_noclip)
{
g_hasNoclip[player] = true
client_print(player, print_chat, "[ZP] To use noclip (bind [key] +noclip)")
g_zclass_noclip_time[player] = get_gametime()
}
}
public cmd_noclip(id)
{
if (!is_user_alive(id) || !zp_get_user_zombie(id))
return PLUGIN_HANDLED
if (zp_get_user_zombie_class(id) != g_zclass10_noclip)
return PLUGIN_CONTINUE
#if defined FOR_ADMINS
if( !( get_user_flags(id) & ADMINACCESS) )
{
client_print(id, print_chat, "[ZP] Sorry, Noclip Zombie is only for admins available.")
return PLUGIN_CONTINUE
}
#endif
fm_set_user_noclip(id, 1)
g_zclass_noclip_time[id] = get_gametime()
if (get_gametime() - g_zclass_noclip_time[id] < get_pcvar_float(g_zclass_noclip_cooldown))
return PLUGIN_HANDLED
return PLUGIN_CONTINUE
}
public cmd_off(id)
{
if (!is_user_alive(id) || !zp_get_user_zombie(id))
return PLUGIN_HANDLED
if (zp_get_user_zombie_class(id) != g_zclass10_noclip)
return PLUGIN_CONTINUE
#if defined FOR_ADMINS
if( !( get_user_flags(id) & ADMINACCESS) )
{
client_print(id, print_chat, "[ZP] Sorry, Noclip Zombie is only for admins available.")
return PLUGIN_CONTINUE
}
#endif
fm_set_user_noclip(id, 0)
set_task(get_pcvar_float(g_zclass_noclip_long), "cmd_off", id)
if (get_gametime() - g_zclass_noclip_time[id] < get_pcvar_float(g_zclass_noclip_cooldown))
return PLUGIN_HANDLED
return PLUGIN_CONTINUE
}
stock fm_set_user_noclip(index, noclip = 0)
{
set_pev(index, pev_movetype, noclip == 1 ? MOVETYPE_NOCLIP : MOVETYPE_WALK);
return 1;
}