Raised This Month: $ Target: $400
 0% 

Detect player moving


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-30-2011 , 18:45   Re: Detect player moving
Reply With Quote #9

Quote:
Originally Posted by xbatista View Post
Thanks guys, but I think the best way is to use engine function: get_speed(id) > 0
PHP Code:
#include <amxmodx>
#include <fakemeta>

new const Version[] = "0.1";

const 
ButtonBits = ( IN_FORWARD IN_BACK IN_MOVELEFT IN_MOVERIGHT );

const 
Float:SlowestRun 210.0//vector_length(velocity) returns 210 when running with AWP

public plugin_init() 
{
    
register_plugin"Detect Moving" Version "bugsy" );
    
    
register_forwardFM_CmdStart "fw_FMCmdStart" );
}

public 
fw_FMCmdStartid handle seed )
{
    if ( 
get_uchandle UC_Buttons ) & ButtonBits )
    {
        static 
Float:fVelocity];

        
pevid pev_velocity fVelocity );
        
client_printid print_chat "You are %s" , ( vector_lengthfVelocity ) >= SlowestRun ) ? "running" "walking" );
    }

__________________

Last edited by Bugsy; 04-30-2011 at 18:51.
Bugsy is offline
 



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 04:28.


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