Raised This Month: $ Target: $400
 0% 

[HELP]Ghost Zombie


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Filcora
Member
Join Date: Nov 2008
Location: Poland ;)
Old 04-01-2009 , 09:47   [HELP]Ghost Zombie
Reply With Quote #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_ghostg_glow_redg_glow_greeng_glow_blueg_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(PLUGINVERSIONAUTHOR)
    
    
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_namezclass_infozclass_modelzclass_clawmodelzclass_healthzclass_speedzclass_gravityzclass_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(playerpev_flTimeStepSound999)
        
    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_handleES_RenderModekRenderTransAlpha)
        
set_es(es_handleES_RenderAmtget_pcvar_num(g_invisible_amount))
        
set_es(es_handleES_RenderFxkRenderFxGlowShell)
        
set_es(es_handleES_RenderColorcolor)
    }
    return 
FMRES_IGNORED
}

public 
fw_TakeDamage(victiminflictorattackerFloat:damagedamage_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
(40.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_ghostg_zclass_ghost_adming_glow_redg_glow_greeng_glow_blueg_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(PLUGINVERSIONAUTHOR)
    
    
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_namezclass_infozclass_modelzclass_clawmodelzclass_healthzclass_speedzclass_gravityzclass_knockback)
    
g_zclass_ghost_admin zp_register_zombie_class(zclass_name2zclass_info2zclass_model2zclass_clawmodel2zclass_health2zclass_speed2zclass_gravity2zclass_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(playerpev_flTimeStepSound999)
        { 
        if (!
is_user_admin(id)) 
        {
        
zp_set_user_zombie_class(idg_zclass_ghost)
        
set_pev(playerpev_flTimeStepSound999)
        }
        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_handleES_RenderModekRenderTransAlpha)
        
set_es(es_handleES_RenderAmtget_pcvar_num(g_invisible_amount))
        
set_es(es_handleES_RenderFxkRenderFxGlowShell)
        
set_es(es_handleES_RenderColorcolor)
    }
    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_handleES_RenderModekRenderTransAlpha)
        
set_es(es_handleES_RenderAmtget_pcvar_num(g_invisible_amount))
        
set_es(es_handleES_RenderFxkRenderFxGlowShell)
        
set_es(es_handleES_RenderColorcolor)
    }
    return 
FMRES_IGNORED
}

public 
fw_TakeDamage(victiminflictorattackerFloat:damagedamage_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
(40.0)
    return 
HAM_HANDLED


It will work?
Filcora is offline
kazuki
Senior Member
Join Date: Dec 2008
Old 04-01-2009 , 10:28   Re: [HELP]Ghost Zombie
Reply With Quote #2

PHP Code:
new const zclass_model[] = { "niewidzialne" 
change to

PHP Code:
new const zclass_model[] = { "niewidzialne.mdl" 
if i not wrong.
kazuki is offline
Old 04-01-2009, 12:23
crazyeffect
This message has been deleted by crazyeffect. Reason: Some people don't think this is usefull
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:29.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode