Member
Join Date: Nov 2008
Location: Poland ;)
|
04-01-2009
, 09:47
[HELP]Ghost Zombie
|
#1
|
Hello, the plugin is an error.
So when the admin selects the class with me on the zombie server is visible: / I have changed the model admin zombie: / Fryc! Save!
Orginal SMA:
PHP Code:
/* [ZP] Class : Ghost Zombie ( Another Zombie ) by Fry!
Description : This is another zombie class only this zombie will be invisible like ghost with [b]Fall resist[/b]. Zombie can be noticed by his orange glow, of course You can change glow.
Cvars : zp_ghost_invisibility "5" - How invisible ghost will be, note that you can only set 0 (max invisible) - 255 ( max visible ) . zp_ghost_glow_red "150" - This is red color. zp_ghost_glow_green "150" - This is green color. zp_ghost_glow_blue "150" - This is blue color.
Credits : Random1 - For his small tutorial! :D > http://forums.alliedmods.net/showpost.php?p=766473&postcount=6
Changelog :
10/11/2008 - v1.0 - First test 11/11/2008 - v1.1 - added zombie can't be visible if it will be frozen. 23/12/2008 - v1.2.2 - added 2 more cvars for red and green color, changed zombie stats was so weak, now ghost zombie will be fall restist. 24/02/2009 - v1.2.9 - removed none working function if you were frozen, added silent footsteps, added cvar for invisibility, corrected some spelling mistakes, fixed if this zombie class was Nemesis, fixed invisibility, optimized code. 25/02/2009 - v1.3.1 - removed useless call functions (connected, disconnected, died), optimized code by adding AddToFullPack since I've never called public ghost zombie. */
#include <amxmodx> #include <fakemeta> #include <hamsandwich> #include <hlsdk_const> #include <zombieplague>
#define PLUGIN "[ZP] Class : Ghost Zombie" #define VERSION "1.3.2" #define AUTHOR "Fry!"
new g_zclass_ghost, g_glow_red, g_glow_green, g_glow_blue, g_invisible_amount new has_silent[33]
new const zclass_name[] = { "Ghost Zombie" } new const zclass_info[] = { "HP+++ Speed- Knockback+ Fall RESIST" } new const zclass_model[] = { "zombie_source" } new const zclass_clawmodel[] = { "v_knife_zombie.mdl" } const zclass_health = 2450 const zclass_speed = 190 const Float:zclass_gravity = 1.0 const Float:zclass_knockback = 1.35
public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_cvar("zp_zclass_ghost_zombie",VERSION,FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_UNLOGGED|FCVAR_SPONLY) g_invisible_amount = register_cvar("zp_ghost_invisibility", "5") g_glow_red = register_cvar("zp_ghost_glow_red", "150") g_glow_green = register_cvar("zp_ghost_glow_green", "150") g_glow_blue = register_cvar("zp_ghost_glow_blue", "150") register_forward(FM_AddToFullPack,"fw_addtofullpack",1) register_forward(FM_PlayerPreThink, "fw_PlayerPreThink") RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage") }
public plugin_precache() { g_zclass_ghost = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback) }
public fw_PlayerPreThink(player) { if(!is_user_alive(player)) return FMRES_IGNORED if(zp_get_user_zombie(player) && zp_get_user_zombie_class(player) == g_zclass_ghost) set_pev(player, pev_flTimeStepSound, 999) return FMRES_IGNORED }
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_nemesis(ent) && zp_get_user_zombie_class(ent) == g_zclass_ghost) { static color[3]; color[0] = get_pcvar_num(g_glow_red); color[1] = get_pcvar_num(g_glow_green); color[2] = get_pcvar_num(g_glow_blue); set_es(es_handle, ES_RenderMode, kRenderTransAlpha) set_es(es_handle, ES_RenderAmt, get_pcvar_num(g_invisible_amount)) set_es(es_handle, ES_RenderFx, kRenderFxGlowShell) set_es(es_handle, ES_RenderColor, color) } return FMRES_IGNORED }
public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type) { // Victim is not taking damage from a fall if (!(damage_type & DMG_FALL) || !zp_get_user_zombie(victim) || zp_get_user_zombie_class(victim) != g_zclass_ghost) return HAM_IGNORED SetHamParamFloat(4, 0.0) return HAM_HANDLED }
My Editet SMA:
PHP Code:
#include <amxmodx> #include <fakemeta> #include <hamsandwich> #include <hlsdk_const> #include <zombieplague>
#define PLUGIN "[ZP] Class : Ghost Zombie" #define VERSION "1.3.2" #define AUTHOR "Fry!"
new g_zclass_ghost, g_zclass_ghost_admin, g_glow_red, g_glow_green, g_glow_blue, g_invisible_amount
new const zclass_name[] = { "Niewidzialne Zombie" } new const zclass_info[] = { "Niewidzialnosc" } new const zclass_model[] = { "niewidzialne" } new const zclass_clawmodel[] = { "v_knife_zombie.mdl" } const zclass_health = 2000 const zclass_speed = 260 const Float:zclass_gravity = 1.0 const Float:zclass_knockback = 1.35
new const zclass_name2[] = { "Niewidzialne Zombie" } new const zclass_info2[] = { "Niewidzialnosc" } new const zclass_model2[] = { "admin_zombie" } new const zclass_clawmodel2[] = { "v_knife_zombie.mdl" } const zclass_health2 = 2000 const zclass_speed2 = 260 const Float:zclass_gravity2 = 1.0 const Float:zclass_knockback2 = 1.35
public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_cvar("zp_zclass_ghost_zombie",VERSION,FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_UNLOGGED|FCVAR_SPONLY) g_invisible_amount = register_cvar("zp_ghost_invisibility", "5") g_glow_red = register_cvar("zp_ghost_glow_red", "150") g_glow_green = register_cvar("zp_ghost_glow_green", "150") g_glow_blue = register_cvar("zp_ghost_glow_blue", "150") register_forward(FM_AddToFullPack,"fw_addtofullpack",1) register_forward(FM_PlayerPreThink, "fw_PlayerPreThink") RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage") }
public plugin_precache() { g_zclass_ghost = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback) g_zclass_ghost_admin = zp_register_zombie_class(zclass_name2, zclass_info2, zclass_model2, zclass_clawmodel2, zclass_health2, zclass_speed2, zclass_gravity2, zclass_knockback2) }
public fw_PlayerPreThink(player) { if(!is_user_alive(player)) return FMRES_IGNORED if (zp_get_user_zombie_class(id) == g_zclass_ghost_admin) set_pev(player, pev_flTimeStepSound, 999) { if (!is_user_admin(id)) { zp_set_user_zombie_class(id, g_zclass_ghost) set_pev(player, pev_flTimeStepSound, 999) } else { } //if(zp_get_user_zombie(player) && zp_get_user_zombie_class(player) == g_zclass_ghost) //set_pev(player, pev_flTimeStepSound, 999) return FMRES_IGNORED }
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_nemesis(ent) && zp_get_user_zombie_class(ent) == g_zclass_ghost) { static color[3]; color[0] = get_pcvar_num(g_glow_red); color[1] = get_pcvar_num(g_glow_green); color[2] = get_pcvar_num(g_glow_blue); set_es(es_handle, ES_RenderMode, kRenderTransAlpha) set_es(es_handle, ES_RenderAmt, get_pcvar_num(g_invisible_amount)) set_es(es_handle, ES_RenderFx, kRenderFxGlowShell) set_es(es_handle, ES_RenderColor, color) } return FMRES_IGNORED if(!is_user_alive(ent) || !is_user_alive(host) || !is_user_admin(id)) return FMRES_IGNORED if(zp_get_user_zombie(ent) && !zp_get_user_nemesis(ent) && zp_get_user_zombie_class(ent) == g_zclass_ghost_admin) { static color[3]; color[0] = get_pcvar_num(g_glow_red); color[1] = get_pcvar_num(g_glow_green); color[2] = get_pcvar_num(g_glow_blue); set_es(es_handle, ES_RenderMode, kRenderTransAlpha) set_es(es_handle, ES_RenderAmt, get_pcvar_num(g_invisible_amount)) set_es(es_handle, ES_RenderFx, kRenderFxGlowShell) set_es(es_handle, ES_RenderColor, color) } return FMRES_IGNORED }
public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type) { // Victim is not taking damage from a fall if (!(damage_type & DMG_FALL) || !zp_get_user_zombie(victim) || zp_get_user_zombie_class(victim) != g_zclass_ghost) return HAM_IGNORED if (!(damage_type & DMG_FALL) || !zp_get_user_zombie(victim) || zp_get_user_zombie_class(victim) != g_zclass_ghost_admin) return HAM_IGNORED SetHamParamFloat(4, 0.0) return HAM_HANDLED }
It will work?
|
|