AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help with invisibility (https://forums.alliedmods.net/showthread.php?t=283121)

EFFx 05-25-2016 21:15

Help with invisibility
 
My guys, i dont know why i get this bug, when the player is on the ground and stop running/walking, he stay invisibility, but when him use the wallhang, the invisibility dont show, why?

Screenshot: http://imgur.com/J5BoPTf

Sorry, the screen is fcking small, i cant open my paint :@

Neeeeeeeeeel.- 05-26-2016 11:47

Re: Help with invisibility
 
A smaller picture would be useful.

Napoleon_be 05-26-2016 14:53

Re: Help with invisibility
 
or a code

EFFx 05-26-2016 14:56

Re: Help with invisibility
 
Quote:

Originally Posted by Neeeeeeeeeel.- (Post 2422166)
A smaller picture would be useful.

Quote:

Originally Posted by Napoleon_be (Post 2422213)
or a code

Someone can help?

wickedd 05-26-2016 15:04

Re: Help with invisibility
 
Not without the code.

EFFx 05-26-2016 15:43

Re: Help with invisibility
 
1 Attachment(s)
Invis:
PHP Code:


new const g_szClassname[ ] = "invisibility"
new Float:g_t_time
new iEnt

public plugin_init()
{
 
iEnt engfuncEngFunc_CreateNamedEntityengfuncEngFunc_AllocString"info_target" ) );
 
 if( 
pev_validiEnt ) )
 {
  
set_peviEntpev_classnameg_szClassname );
  
global_getglb_timeg_t_time );
  
set_peviEntpev_nextthinkg_t_time 0.1 );
  
register_thinkg_szClassname"think_Invisibility" );
 } 
 else 
 {
  
set_task0.1"think_Invisibility", .flags="b" )
 }


PHP Code:


public think_InvisibilityEnt )
{
 if( 
Ent != iEnt )
  return 
FMRES_IGNORED;
  
 
g_t_time += 0.1;
 
entity_set_floatEntEV_FL_nextthinkg_t_time );
 
//set_pev( Ent, pev_nextthink, g_t_time );
 //entity_set_float( Ent, EV_FL_nextthink, get_gametime( ) + 0.1 );
 
 
new iAliveiWeapon;
 for( new 
1<= g_iMaxPlayersi++ )
 {
  
iWeapon get_user_weapon);
  
iAlive is_user_alive);
  
  if( 
iAlive )
  {
   if( ( 
iWeapon == CSW_KNIFE || iWeapon == CSW_SMOKEGRENADE || iWeapon == CSW_TMP) && get_user_team) == )
   {
    new 
Float:fVec], iSpeed;
    
entity_get_vectoriEV_VEC_velocityfVec );
    
iSpeed floatroundvector_lengthfVec ) );
    
    if( 
iSpeed 255 )
    {
      
set_user_renderingikRenderFxNone000kRenderTransAlphaiSpeed );
    } 
    else 
    {
     
set_user_renderingikRenderFxNone000kRenderNormal);
    }
   } 
   else 
   {
    
set_user_renderingikRenderFxNone000kRenderNormal);
   }
  }
 }
 
 return 
FMRES_IGNORED;


And the wallhang is here:

EFFx 05-26-2016 19:55

Re: Help with invisibility
 
Anyone?

siriusmd99 05-31-2016 08:43

Re: Help with invisibility
 
PHP Code:


public think_InvisibilityEnt )
{
 if( 
Ent != iEnt )
  return 
FMRES_IGNORED;
  
 
g_t_time += 0.1;
 
entity_set_floatEntEV_FL_nextthinkg_t_time );
 
//set_pev( Ent, pev_nextthink, g_t_time );
 //entity_set_float( Ent, EV_FL_nextthink, get_gametime( ) + 0.1 );
 
 
new iWeapon;
 for( new 
1<= g_iMaxPlayersi++ )
 { 
  if( 
is_user_alive(i) )
  {

     
iWeapon get_user_weapon);
    if( ( 
iWeapon == CSW_KNIFE || iWeapon == CSW_SMOKEGRENADE || iWeapon == CSW_TMP) && get_user_team) == )
   {
    new 
Float:fVec], Float:iSpeed;
    
entity_get_vectoriEV_VEC_velocityfVec );
    
iSpeed vector_lengthfVec);
      
set_user_renderingikRenderFxNone000kRenderTransAlphaiSpeed 255 floatround(iSpeed 2) : 255 );
   
 }
 }
}
 return 
FMRES_IGNORED;



EFFx 05-31-2016 16:50

Re: Help with invisibility
 
Is only when i'm using wallhang, but when i'm at the ground, the invisibility work, idk why.

Napoleon_be 06-01-2016 03:20

Re: Help with invisibility
 
Just check when wallhang gets activated, if so, set_user_rendering() as in your invis code. That should do it imo.

I'm not sure, but i think everytime you hit the wall and keep hanging, this causes the set_user_rendering to reset everytime.


All times are GMT -4. The time now is 18:40.

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