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(PLUGIN, VERSION, AUTHOR)
register_forward(FM_CmdStart, "fwdCmdStart");
}
public plugin_precache()
m_LaserBeam = precache_model("sprites/laserbeam.spr");
public fwdCmdStart(id, uc_handle, uc_seed)
{
if(!is_user_alive(id))
return FMRES_IGNORED;
static iButton;
iButton = get_uc(uc_handle, UC_Buttons);
//new NoDraw = pev(id, pev_effects, EF_NODRAW)
if(~iButton & IN_ATTACK)
{
if(!get_entity_visibility(id))
{
new origin[3]
get_user_origin(id, origin, 0)
//do stuff
message_begin(MSG_PVS, SVC_TEMPENTITY, origin, id)
write_byte( TE_BEAMCYLINDER );
write_coord( origin[0] );
write_coord( origin[1] );
write_coord( origin[2] );
write_coord( origin[0] );
write_coord( origin[1] );
write_coord( origin[2] + 512 );
write_short( m_LaserBeam );
write_byte( 0 ); // startframe
write_byte( 0 ); // framerate
write_byte( 1 ); // life
write_byte( 8 ); // width
write_byte( 0 ); // noise
write_byte( 255 ); // r, g, b
write_byte( 255 ); // r, g, b
write_byte( 255 ); // r, g, b
write_byte( 128 ); //brightness
write_byte( 0 ); // 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(id, 1)
}
}
return FMRES_IGNORED;
}
__________________