View Single Post
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 03-15-2019 , 09:59   Re: A specific effect when the player moves/standing
Reply With Quote #7

Quote:
Originally Posted by Moody92 View Post
He was general in his request if you re-read it.

PHP Code:
#include <amxmodx> 
#include <fakemeta> 
#include <fun>

new const Version[] = "0.1"

//Delete the below line if compiler throws error: Error: Invalid symbol name "" on line 6 
const MAX_PLAYERS 32

const 
ButtonBits = ( IN_FORWARD IN_BACK IN_MOVELEFT IN_MOVERIGHT IN_JUMP ); 

enum Origins 

    
StartOrigin
    
EndOrigin 
}; 

new 
g_IsMoving
new 
Float:g_fOriginsMAX_PLAYERS ][ Origins ][ ]; 

public 
plugin_init()  

    
register_plugin"Glowing moving players" Version "bugsy" ); 
     
    
register_forwardFM_CmdStart "fw_FMCmdStart" ); 


public 
client_disconnectid 

    
g_IsMoving &= ~( << id ); 


public 
fw_FMCmdStartid handle seed 

    static 
Float:fVelocity]; 
     
    if ( 
get_uchandle UC_Buttons ) & ButtonBits 
    { 
        
pevid pev_velocity fVelocity ); 
         
        if ( !( 
g_IsMoving & ( << id ) ) ) 
        { 
            if ( 
vector_lengthfVelocity ) ) 
            { 
                
client_started_movingid ); 
            } 
        } 
        else if ( !
vector_lengthfVelocity ) ) 
        { 
            
client_stopped_movingid ); 
        } 
    } 
    else if ( 
g_IsMoving & ( << id ) ) 
    { 
        
client_stopped_movingid ); 
    } 
}   

public 
client_started_movingid 

    
g_IsMoving |= ( << id ); 
    
pevid pev_origin g_fOriginsid ][ StartOrigin ] ); 
     
    
set_user_rendering(idkRenderFxGlowShellrandom_num(0,255), random_num(0,255), random_num(0,255), kRenderNormalrandom_num(0,255))


public 
client_stopped_movingid 

    
g_IsMoving &= ~( << id ); 
    
pevid pev_origin g_fOriginsid ][ EndOrigin ] ); 
         
    
set_user_rendering(idkRenderFxNone000kRenderNormal16);

From the topic I quoted in my previous post. All I did was add the rendering lines. Whenever a player moves, they're gonna have a random glow. When they stop, their glow is going to disappear.

Only downside to this is when player is falling, being slapped, etc. It's not going to be considered as movement unless they're holding their movement keys as discussed in the topic.
Thanks a lot.
I'm just starting to think why on this site everything has to be too complicated when the help is in question.
I tested your plugin and worked fine.
__________________
Check my original plugins for cs 1.6 and subscribe on channel
Look at the video bellow to see zombie frost grenade

https://youtu.be/j0zspNfN-AM?si=_1IiGPETN-GQY9Ua

Look at the video below to see Zombie blind grenade

https://youtu.be/ORC7ZmoaipQ?si=QC8Bul96QGitUwX4
Krtola is offline
Send a message via Skype™ to Krtola