Raised This Month: $ Target: $400
 0% 

[ZP] Invisible Zombie (Help)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Anggara_nothing
Veteran Member
Join Date: Jan 2009
Location: Indonesia
Old 04-15-2009 , 20:20   Re: [ZP] Invisible Zombie (Help)
Reply With Quote #2

PHP Code:
/*================================================================================
    
    -----------------------------------
    -*- [ZP] Class : Invisible Zombie -*-
    -----------------------------------
    
    ~~~~~~~~~~~~~~~
    - Description -
    ~~~~~~~~~~~~~~~
    
    Press the key [E] to be Invisible.
    
================================================================================*/

#include <amxmodx>
#include <zombieplague>
#include <fakemeta>

new g_activated[33];
new 
maxplayers;

// Zombie attribute
new g_zclass_izombieg_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()
{
    
maxplayers get_maxplayers()
    static 
id;
    for (
id 1id <= maxplayersid++)
        
g_activated[id] = 0
    
    register_plugin
("[ZP] Zombie Classes : Invisible Zombie""1.0""zombieplague")
    
g_invisible_amount register_cvar("zp_izombie_invisibility""100")
    
register_forward(FM_CmdStart"CmdStart");
    
    
g_zclass_izombie zp_register_zombie_class(zclass_namezclass_infozclass_modelzclass_clawmodelzclass_healthzclass_speedzclass_gravityzclass_knockback)
}

public 
zp_user_infected_post(playerinfector)
{
    if (
zp_get_user_zombie_class(player) == g_zclass_izombie)
    {
        
client_print(playerprint_chat"[ZP] To be Invisible press the key [E].")       
    }
}
 
public 
CmdStart(ClientHandle)
{

    if(!
is_user_alive(Client) || !is_user_alive(Client))
        return 
FMRES_IGNORED
    
    
static ButtonsOldButtons;
    
Buttons get_uc(HandleUC_Buttons);
    
OldButtons pev(Clientpev_oldbuttons);

    if(
zp_get_user_zombie(Client) && zp_get_user_zombie_class(Client) == g_zclass_izombie)
    {
        if ((
Buttons IN_USE) && !(OldButtons IN_USE))
        {
            
g_activated[Client] = 1
            set_task
(get_pcvar_float(g_invisible_amount), "uninvisible"Client)
            
fm_set_rendering(ClientkRenderFxGlowShell,0,0,0,kRenderTransAlpha50)
        }
        else if(
g_activated[Client])
            
client_print(Clientprint_chat"[ZP] You're already invisible.")
            
    }
    
    return 
FMRES_IGNORED
}

public 
uninvisible(taskid)
{
    
fm_set_rendering(taskidkRenderFxNone0,0,0,kRenderNormal255)
    
g_activated[taskid] = 0
}

stock fm_set_rendering(entityfx kRenderFxNone255255255render kRenderNormalamount 255
{
    new 
Float:RenderColor[3];
    
RenderColor[0] = float(r);
    
RenderColor[1] = float(g);
    
RenderColor[2] = float(b);

    
set_pev(entitypev_renderfxfx);
    
set_pev(entitypev_rendercolorRenderColor);
    
set_pev(entitypev_rendermoderender);
    
set_pev(entitypev_renderamtfloat(amount));

    return 
1;

Anggara_nothing is offline
 



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 02:21.


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