Raised This Month: $94 Target: $400
 23% 

[ZP] Zombie Class : Invisible Cat


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Gameplay        Approver:   Exolent[jNr] (178)
Anggara_nothing
Veteran Member
Join Date: Jan 2009
Location: Indonesia
Old 04-14-2009 , 03:29   [ZP] Zombie Class : Invisible Cat
Reply With Quote #1


[ZP] Zombie Class : Invisible Cat

Description:
The zombie can invisible if he/she not move, jump or attack. Have long jump.

Cvar:
zp_inviscat_amount 45 --> amount of invisible.

Credit:
Hello-World
arkshine

update logs:
1.1 ---> using fun code, thanks arkshine.
1.2 ---> add a cvar.
Attached Files
File Type: sma Get Plugin or Get Source (zp_zclass_cat.sma - 13398 views - 2.3 KB)
File Type: zip cat_models.zip (121.6 KB, 10219 views)

Last edited by Anggara_nothing; 05-20-2010 at 10:02. Reason: update V 1.2
Anggara_nothing is offline
tuty
Veteran Member
Join Date: Jul 2008
Location: Romania
Old 04-14-2009 , 06:17   Re: [ZP] Zombie Class : Invisible Cat
Reply With Quote #2

sorry but the cat sequences looks like shit
__________________
All my lifetime work is there (includin private big ass plugins and stuff) https://github.com/tutyamxx

tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
Nextra
Veteran Member
Join Date: Apr 2008
Location: Germany
Old 04-14-2009 , 06:39   Re: [ZP] Zombie Class : Invisible Cat
Reply With Quote #3

PHP Code:
    new button pev(idpev_button)

    if(!
is_user_alive(id))
        return ;
 
//... 
-->

PHP Code:
    if(!is_user_alive(id))
        return ;
        
    if(!
zp_get_user_zombie(id))
        return ;
    
    if(
zp_get_user_zombie_class(id) != g_cat_class)
        return;

    new 
button pev(idpev_button
and


PHP Code:
stock fm_set_rendering(entityfx kRenderFxNone255255255render kRenderNormalamount 16
{
    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;

-->


PHP Code:
stock fm_set_rendering(entityfx kRenderFxNoneFloat:RenderColor[3] = {255.0,255.0,255.0}, render kRenderNormalFloat:amount 16.0
{
    
set_pev(entitypev_renderfxfx);
    
set_pev(entitypev_rendercolorRenderColor);
    
set_pev(entitypev_rendermoderender);
    
set_pev(entitypev_renderamtamount);

    return 
1;

and:

PHP Code:
fm_set_rendering(idkRenderFxNone0,0,0,kRenderNormal255)
//..
fm_set_rendering(idkRenderFxGlowShell,0,0,0,kRenderTransAlpha45
-->

PHP Code:
fm_set_rendering(idkRenderFxNoneFloat:{0.0,0.0,0.0},kRenderNormal255.0)
//..
fm_set_rendering(idkRenderFxGlowShell,Float:{0.0,0.0,0.0},kRenderTransAlpha45.0
__________________
In Flames we trust!

Last edited by Nextra; 04-14-2009 at 07:34.
Nextra is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-14-2009 , 06:59   Re: [ZP] Zombie Class : Invisible Cat
Reply With Quote #4

- You should use set_user_rendering() from fun instead of fakemeta, it will be more efficient.
- You should use FM_CmdStart instead of PlayerPreThink, but is really need just to glow ?
- Like said Nextra, you should move pev_button, but I would reorganize like this to avoid returs :

Code:
const MOVE_BUTTONS = ( IN_ATTACK | IN_ATTACK2 | IN_BACK | IN_FORWARD | IN_RUN | IN_JUMP | IN_MOVELEFT | IN_MOVERIGHT | IN_LEFT | IN_RIGHT );

Code:
    if ( is_user_alive( id ) && zp_get_user_zombie( id ) && zp_get_user_zombie_class(id) == g_cat_class )     {         pev( id, pev_button ) & MOVE_BUTTONS ?                     set_user_rendering(id, kRenderFxNone, 0,0,0,kRenderNormal, 255) :             set_user_rendering(id, kRenderFxGlowShell,0,0,0,kRenderTransAlpha, 45);     }

Last edited by Arkshine; 04-14-2009 at 14:50.
Arkshine is offline
Anggara_nothing
Veteran Member
Join Date: Jan 2009
Location: Indonesia
Old 04-14-2009 , 07:03   Re: [ZP] Zombie Class : Invisible Cat
Reply With Quote #5

Quote:
Originally Posted by Nextra View Post
PHP Code:
    new button pev(idpev_button)

    if(!
is_user_alive(id))
        return ;
 
//... 
-->

PHP Code:
    if(!is_user_alive(id))
        return ;
        
    if(!
zp_get_user_zombie(id))
        return ;
    
    if(
zp_get_user_zombie_class(id) != g_cat_class)
        return;

    new 
button pev(idpev_button
and


PHP Code:
stock fm_set_rendering(entityfx kRenderFxNone255255255render kRenderNormalamount 16
{
    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;

-->


PHP Code:
stock fm_set_rendering(entityfx kRenderFxNoneFloat:RenderColor[3] = {255.0,255.0,255,0}, render kRenderNormalFloat:amount 16.0
{
    
set_pev(entitypev_renderfxfx);
    
set_pev(entitypev_rendercolorRenderColor);
    
set_pev(entitypev_rendermoderender);
    
set_pev(entitypev_renderamtamount);

    return 
1;

and:

PHP Code:
fm_set_rendering(idkRenderFxNone0,0,0,kRenderNormal255)
//..
fm_set_rendering(idkRenderFxGlowShell,0,0,0,kRenderTransAlpha45
-->

PHP Code:
fm_set_rendering(idkRenderFxNoneFloat:{0.0,0.0,0.0},kRenderNormal255.0)
//..
fm_set_rendering(idkRenderFxGlowShell,Float:{0.0,0.0,0.0},kRenderTransAlpha45.0
i get error about "stock fm_set_rendering"
Quote:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

Warning: Tag mismatch on line 76
Warning: Tag mismatch on line 76
Error: Initialization data exceeds declared size on line 76

1 Error.
Anggara_nothing is offline
Anggara_nothing
Veteran Member
Join Date: Jan 2009
Location: Indonesia
Old 04-14-2009 , 07:03   Re: [ZP] Zombie Class : Invisible Cat
Reply With Quote #6

Quote:
Originally Posted by tuty View Post
sorry but the cat sequences looks like shit
Because i'm not modeller.
Anggara_nothing is offline
Anggara_nothing
Veteran Member
Join Date: Jan 2009
Location: Indonesia
Old 04-14-2009 , 07:09   Re: [ZP] Zombie Class : Invisible Cat
Reply With Quote #7

Quote:
Originally Posted by arkshine View Post
- You should use set_user_rendering() from fun instead of fakemeta, it will be more efficient.
- You should use FM_CmdStart instead of PlayerPreThink, but is really need just to glow ?
- Like said Nextra, you should move pev_button, but I would reorganize like this to avoid returs :

Code:
#define MOVE_BUTTONS ( IN_ATTACK | IN_ATTACK2 | IN_BACK | IN_FORWARD | IN_RUN | IN_JUMP | IN_MOVELEFT | IN_MOVERIGHT | IN_LEFT | IN_RIGHT )

Code:
    if ( is_user_alive( id ) && zp_get_user_zombie( id ) && zp_get_user_zombie_class(id) == g_cat_class )     {         pev( id, pev_button ) & MOVE_BUTTONS ?                     set_user_rendering(id, kRenderFxNone, 0,0,0,kRenderNormal, 255) :             set_user_rendering(id, kRenderFxGlowShell,0,0,0,kRenderTransAlpha, 45);     }
1. you're right. thanks.
2. i don't understand, sorry.
3. why?
Anggara_nothing is offline
Nextra
Veteran Member
Join Date: Apr 2008
Location: Germany
Old 04-14-2009 , 07:35   Re: [ZP] Zombie Class : Invisible Cat
Reply With Quote #8

Quote:
Originally Posted by Anggara_nothing View Post
i get error about "stock fm_set_rendering"
Was just a typo (255,0 instead of 255.0). Fixed now but you don't need it anymore anyway ;)
__________________
In Flames we trust!
Nextra is offline
D-TOX
Member
Join Date: Mar 2008
Old 04-14-2009 , 07:43   Re: [ZP] Zombie Class : Invisible Cat
Reply With Quote #9

Quote:
Originally Posted by tuty View Post
sorry but the cat sequences looks like shit
I've made a simple retexture of the actual cat. Though the whole model needs to be re-done ^^

http://data.fuskbugg.se/skalman01/cat2.bmp

Its a 256-colours BMP.

Last edited by D-TOX; 04-14-2009 at 07:45. Reason: Added .bmp file instead
D-TOX is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-14-2009 , 07:44   Re: [ZP] Zombie Class : Invisible Cat
Reply With Quote #10

2. Forget, for your need Prethink is fine actually. But I'm still wondering if there is not a more appropriate way to do that instead applying a lot of times the glow when it needs only one time. You could use the provided ZP forward when player becomes zombie and back human, then applying glow at this time.
3. You have to do the checks before retrieving player's buttons and about the returns, it will just generate less code.

Last edited by Arkshine; 04-14-2009 at 07:49.
Arkshine is offline
Reply


Thread Tools
Display Modes

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 23:25.


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