Raised This Month: $12 Target: $400
 3% 

A specific effect when the player moves/standing


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 03-14-2019 , 08:05   A specific effect when the player moves/standing
Reply With Quote #1

I want to set a certain effect when the player moves and also when they are not moving.

For example,if player move they will have glow effect.
If player not moving that glow effect will disappear.

Any help is welcome.
Thanks in advance.
__________________
Check my original plugins for cs 1.6 and subscribe on channel
Look at the video below to see blind grenade for zombies

https://www.youtube.com/watch?v=ORC7ZmoaipQ

Look at the video below to see Zombie Hide And Seek mode

https://www.youtube.com/watch?v=xpyYb65EgGs
Krtola is offline
Send a message via Skype™ to Krtola
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 03-14-2019 , 08:08   Re: A specific effect when the player moves/standing
Reply With Quote #2

Constantly check if the player is moving(his speed is not 0). If he is, apply glow, else remove glow.
__________________
HamletEagle is offline
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 03-14-2019 , 08:37   Re: A specific effect when the player moves/standing
Reply With Quote #3

Quote:
Originally Posted by HamletEagle View Post
Constantly check if the player is moving(his speed is not 0). If he is, apply glow, else remove glow.
Can u wryte code please?
__________________
Check my original plugins for cs 1.6 and subscribe on channel
Look at the video below to see blind grenade for zombies

https://www.youtube.com/watch?v=ORC7ZmoaipQ

Look at the video below to see Zombie Hide And Seek mode

https://www.youtube.com/watch?v=xpyYb65EgGs
Krtola is offline
Send a message via Skype™ to Krtola
Moody92
Veteran Member
Join Date: May 2011
Location: Oman
Old 03-14-2019 , 09:28   Re: A specific effect when the player moves/standing
Reply With Quote #4

Quote:
Originally Posted by SonicSonedit View Post
In your case, yes.
PHP Code:
static Float:Velocity[3], i pev(idpev_velocityVelocity) if (Velocity[0] > 0.0 || Velocity[1] > 0.0 || Velocity[2] > 0.0
Use static: the differance between new and static is that static variables are not allocated (destroyed&re-created) each time function is called, and prethink is called goddamn pretty often. You can also check some KZ & Deathrun plugins, they are really good examples.
I can't code now but here this might help.

Last edited by Moody92; 03-14-2019 at 09:29.
Moody92 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 03-14-2019 , 10:49   Re: A specific effect when the player moves/standing
Reply With Quote #5

If he wanted to know how to code, he would have posted in the Scripting Help section.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Moody92
Veteran Member
Join Date: May 2011
Location: Oman
Old 03-15-2019 , 05:17   Re: A specific effect when the player moves/standing
Reply With Quote #6

Quote:
Originally Posted by OciXCrom View Post
If he wanted to know how to code, he would have posted in the Scripting Help section.
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.
Moody92 is offline
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 below to see blind grenade for zombies

https://www.youtube.com/watch?v=ORC7ZmoaipQ

Look at the video below to see Zombie Hide And Seek mode

https://www.youtube.com/watch?v=xpyYb65EgGs
Krtola is offline
Send a message via Skype™ to Krtola
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 03-15-2019 , 12:25   Re: A specific effect when the player moves/standing
Reply With Quote #8

Quote:
I'm just starting to think why on this site everything has to be too complicated when the help is in question.
What was so complicated?

You requested something at: Yesterday , 07:05 AM
You got a fully working solution at: Today , 04:17 AM
Not even 24 hours.

I swear the entitlement this days is above the roof.
__________________

Last edited by HamletEagle; 03-15-2019 at 12:26.
HamletEagle is offline
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 03-16-2019 , 09:34   Re: A specific effect when the player moves/standing
Reply With Quote #9

Quote:
Originally Posted by HamletEagle View Post
What was so complicated?

You requested something at: Yesterday , 07:05 AM
You got a fully working solution at: Today , 04:17 AM
Not even 24 hours.

I swear the entitlement this days is above the roof.
It referred to post #5
__________________
Check my original plugins for cs 1.6 and subscribe on channel
Look at the video below to see blind grenade for zombies

https://www.youtube.com/watch?v=ORC7ZmoaipQ

Look at the video below to see Zombie Hide And Seek mode

https://www.youtube.com/watch?v=xpyYb65EgGs
Krtola is offline
Send a message via Skype™ to Krtola
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 03-16-2019 , 10:10   Re: A specific effect when the player moves/standing
Reply With Quote #10

And post #5 referred to posts #2 and #4 in YOUR favor.
__________________

Last edited by OciXCrom; 03-16-2019 at 10:10.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Reply


Thread Tools
Display Modes

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 14:57.


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