Raised This Month: $ Target: $400
 0% 

setting EF_NODRAW on a player (rendering them with no alpha wont work)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
HLM
Senior Member
Join Date: Apr 2008
Location: C:\WINDOWS\System32
Old 05-20-2010 , 16:13   setting EF_NODRAW on a player (rendering them with no alpha wont work)
Reply With Quote #1

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <fun>
#include <fakemeta>

#define PLUGIN "Block Spy Invisible Sniping"
#define VERSION "1.0"
#define AUTHOR "Master"

new m_LaserBeam //= precache_model("sprites/laserbeam.spr");

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_forward(FM_CmdStart"fwdCmdStart");
}

public 
plugin_precache()
    
m_LaserBeam precache_model("sprites/laserbeam.spr");


public 
fwdCmdStart(iduc_handleuc_seed)
{
    new 
NoDraw pev(id,pev_effectsEF_NODRAW);
    if(!
is_user_alive(id))
        return 
FMRES_IGNORED;
    
    static 
iButton;
    
iButton get_uc(uc_handleUC_Buttons);
    
    
    if(~
iButton IN_ATTACK)
    {
        if(
pev_valid(NoDraw))
        {
            new 
origin[3]
            
get_user_origin(idorigin0)
            
//do stuff
            
message_begin(MSG_PVSSVC_TEMPENTITYoriginid)
            
write_byteTE_BEAMCYLINDER );
            
write_coordorigin[0] );
            
write_coordorigin[1] );
            
write_coordorigin[2] );
            
write_coordorigin[0] );
            
write_coordorigin[1] );
            
write_coordorigin[2] + 512 );
            
write_shortm_LaserBeam );
            
write_byte); // startframe
            
write_byte); // framerate
            
write_byte); // life
            
write_byte);  // width
            
write_byte);   // noise
            
write_byte255 );   // r, g, b
            
write_byte255 );   // r, g, b
            
write_byte255 );   // r, g, b
            
write_byte128 ); //brightness
            
write_byte);        // speed
            
message_end();
            
            
//pEntity->v.effects |= EF_NODRAW;
            
set_pev(id,pev_effects, &~EF_NODRAW);
            
//set_user_rendering(id,kRenderFxGlowShell,0,0,0,kRenderNormal,25); THIS FAILS TO WORK
        
}
    }
    return 
FMRES_IGNORED;

I dont know how to do it
__________________
+|- KARMA Respectively

HLM is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-20-2010 , 19:40   Re: setting EF_NODRAW on a player (rendering them with no alpha wont work)
Reply With Quote #2

set_entity_visibility() and get_entity_visibility() in engine_stocks.inc
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
HLM
Senior Member
Join Date: Apr 2008
Location: C:\WINDOWS\System32
Old 05-20-2010 , 19:53   Re: setting EF_NODRAW on a player (rendering them with no alpha wont work)
Reply With Quote #3

okay, thanks exolent, but my code is failing to work, it will keep resetting invisibility when someone is NOT holding attack key, which is the opposite of what I was aiming for, I want to set the user as visible when they are previously invisible and are holding the attack key. (if that makes sense)

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <engine>
#include <fun>
#include <fakemeta>

#define PLUGIN "Block Spy Invisible Sniping"
#define VERSION "1.0"
#define AUTHOR "Master"

new m_LaserBeam //= precache_model("sprites/laserbeam.spr");

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_forward(FM_CmdStart"fwdCmdStart");
    
}

public 
plugin_precache()
    
m_LaserBeam precache_model("sprites/laserbeam.spr");


public 
fwdCmdStart(iduc_handleuc_seed)
{
    if(!
is_user_alive(id))
        return 
FMRES_IGNORED;
    
    static 
iButton;
    
iButton get_uc(uc_handleUC_Buttons);
    
//new NoDraw = pev(id, pev_effects, EF_NODRAW)
    
    
if(~iButton IN_ATTACK)
    {
        if(!
get_entity_visibility(id))
        {
            
            new 
origin[3]
            
get_user_origin(idorigin0)
            
//do stuff
            
message_begin(MSG_PVSSVC_TEMPENTITYoriginid)
            
write_byteTE_BEAMCYLINDER );
            
write_coordorigin[0] );
            
write_coordorigin[1] );
            
write_coordorigin[2] );
            
write_coordorigin[0] );
            
write_coordorigin[1] );
            
write_coordorigin[2] + 512 );
            
write_shortm_LaserBeam );
            
write_byte); // startframe
            
write_byte); // framerate
            
write_byte); // life
            
write_byte);  // width
            
write_byte);   // noise
            
write_byte255 );   // r, g, b
            
write_byte255 );   // r, g, b
            
write_byte255 );   // r, g, b
            
write_byte128 ); //brightness
            
write_byte);        // speed
            
message_end();
            
            
            
//pEntity->v.effects |= EF_NODRAW;
            //set_pev(id,pev_effects, & ~EF_NODRAW);
            //set_user_rendering(id,kRenderFxGlowShell,0,0,0,kRenderNormal,25); //THIS FAILS TO WORK
            
set_entity_visibility(id1)
        }
    }
    return 
FMRES_IGNORED;

__________________
+|- KARMA Respectively

HLM is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-20-2010 , 19:59   Re: setting EF_NODRAW on a player (rendering them with no alpha wont work)
Reply With Quote #4

So only show the player when the player is attacking?
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
HLM
Senior Member
Join Date: Apr 2008
Location: C:\WINDOWS\System32
Old 05-20-2010 , 20:46   Re: setting EF_NODRAW on a player (rendering them with no alpha wont work)
Reply With Quote #5

yes, and I already have the part of the plugin where the player is invisible otherwise
__________________
+|- KARMA Respectively

HLM is offline
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 03:42.


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