Raised This Month: $ Target: $400
 0% 

Invisible and visible for player


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
langgiong123
Junior Member
Join Date: Feb 2014
Old 07-27-2014 , 01:52   Invisible and visible for player
Reply With Quote #1

Hello.
I 've code this plugin for Terrorist : When they stand still, they will be invisible. When they move, they will be visible.
Here is the code :
Code:
if(cs_get_user_team(player1) == CS_TEAM_T)
	{
		if(get_user_maxspeed(player1) == 0)
		{
			set_user_rendering(player1,kRenderFxNone,0,0,0,kRenderTransAlpha,0) 
		}
		if(get_user_maxspeed(player1) > 1)
		{
			set_user_rendering(player1,kRenderFxNone,0,0,0,kRenderTransAlpha,50)
		}
But in game, player are always visible when they stand still
Can anyone help me
langgiong123 is offline
RateX
Veteran Member
Join Date: Jun 2012
Location: 0o. SEA .o0
Old 07-27-2014 , 02:31   Re: Invisible and visible for player
Reply With Quote #2

Try to put it in client_prethink or client_postthink. This method might produce message overflown, so post it here should that happen
RateX is offline
langgiong123
Junior Member
Join Date: Feb 2014
Old 07-27-2014 , 02:39   Re: Invisible and visible for player
Reply With Quote #3

Quote:
Originally Posted by RateX View Post
Try to put it in client_prethink or client_postthink. This method might produce message overflown, so post it here should that happen
Can you help me make the code
I'm newbie
langgiong123 is offline
Eagle07
Veteran Member
Join Date: May 2014
Location: Morocco :D
Old 07-27-2014 , 02:41   Re: Invisible and visible for player
Reply With Quote #4

use this ^^
PHP Code:
#include <amxmodx> 
#include <engine> 
#include <fun> 

#define PLUGIN "Invisibility" 
#define VERSION "1.0" 
#define AUTHOR "ConnorMcLeod" 

new g_iInvisFactor 

public plugin_init() { 
    
register_plugin(PLUGINVERSIONAUTHOR
     
    new 
iEnt 
    iEnt 
create_entity("info_target"
    
entity_set_string(iEntEV_SZ_classname"check_speed"
    
entity_set_float(iEntEV_FL_nextthinkget_gametime() + 0.1
    
register_think("check_speed""Set_Furiens_Visibility"


public 
Set_Furiens_Visibility(iEnt

    
entity_set_float(iEntEV_FL_nextthinkget_gametime() + 0.1

    new 
iPlayers[32], iNumFloat:fVecVelocity[3], iSpeed 

    get_players
(iPlayersiNum"a"

    new 
iPlayer
    for(new 
iiNumi++) 
    { 
        
iPlayer iPlayers[i
        if(
get_user_weapon(iPlayer) == CSW_KNIFE
        { 
            
entity_get_vector(iPlayerEV_VEC_velocityfVecVelocity
            
iSpeed floatround(vector_length(fVecVelocity)) 
            if(
iSpeed g_iInvisFactor*255
            { 
                
set_user_rendering(iPlayerkRenderFxNone000kRenderTransAlphaiSpeed/g_iInvisFactor
            } 
            else 
            { 
                
set_user_rendering(iPlayerkRenderFxNone000kRenderNormal0
            } 
        } 
        else 
        { 
            
set_user_rendering(iPlayerkRenderFxNone000kRenderNormal0
        } 
    } 

__________________
Eagle07 is offline
langgiong123
Junior Member
Join Date: Feb 2014
Old 07-27-2014 , 02:53   Re: Invisible and visible for player
Reply With Quote #5

Quote:
Originally Posted by Eagle07 View Post
use this ^^
PHP Code:
#include <amxmodx> 
#include <engine> 
#include <fun> 

#define PLUGIN "Invisibility" 
#define VERSION "1.0" 
#define AUTHOR "ConnorMcLeod" 

new g_iInvisFactor 

public plugin_init() { 
    
register_plugin(PLUGINVERSIONAUTHOR
     
    new 
iEnt 
    iEnt 
create_entity("info_target"
    
entity_set_string(iEntEV_SZ_classname"check_speed"
    
entity_set_float(iEntEV_FL_nextthinkget_gametime() + 0.1
    
register_think("check_speed""Set_Furiens_Visibility"


public 
Set_Furiens_Visibility(iEnt

    
entity_set_float(iEntEV_FL_nextthinkget_gametime() + 0.1

    new 
iPlayers[32], iNumFloat:fVecVelocity[3], iSpeed 

    get_players
(iPlayersiNum"a"

    new 
iPlayer
    for(new 
iiNumi++) 
    { 
        
iPlayer iPlayers[i
        if(
get_user_weapon(iPlayer) == CSW_KNIFE
        { 
            
entity_get_vector(iPlayerEV_VEC_velocityfVecVelocity
            
iSpeed floatround(vector_length(fVecVelocity)) 
            if(
iSpeed g_iInvisFactor*255
            { 
                
set_user_rendering(iPlayerkRenderFxNone000kRenderTransAlphaiSpeed/g_iInvisFactor
            } 
            else 
            { 
                
set_user_rendering(iPlayerkRenderFxNone000kRenderNormal0
            } 
        } 
        else 
        { 
            
set_user_rendering(iPlayerkRenderFxNone000kRenderNormal0
        } 
    } 

Thank you so much, it work
langgiong123 is offline
Old 07-27-2014, 03:14
Eagle07
This message has been deleted by YamiKaitou. Reason: pointless posts
langgiong123
Junior Member
Join Date: Feb 2014
Old 07-27-2014 , 03:42   Re: Invisible and visible for player
Reply With Quote #7

Quote:
Originally Posted by Eagle07 View Post
np , yr welcome
Can you help me this code has following requirements :
When they stand still, they will be invisible. When they move, their redering is 45.
And it's only for T Team
langgiong123 is offline
langgiong123
Junior Member
Join Date: Feb 2014
Old 07-27-2014 , 02:56   Re: Invisible and visible for player
Reply With Quote #8

But I want this code :
When they stand still, they will be invisible. When they move, their redering is 45.
And it's only for T Team
Sorry for bad English

Last edited by langgiong123; 07-27-2014 at 03:17.
langgiong123 is offline
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 07-27-2014 , 06:15   Re: Invisible and visible for player
Reply With Quote #9

You just got a code snippet, you could as well try yourself.
mottzi is offline
Send a message via MSN to mottzi
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 13:06.


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