Raised This Month: $ Target: $400
 0% 

How to detect


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
zombieplague
Veteran Member
Join Date: Apr 2009
Old 06-21-2010 , 10:30   How to detect
Reply With Quote #1

How to detect if the person is moving or not moving ??
zombieplague is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-21-2010 , 11:34   Re: How to detect
Reply With Quote #2

Check his velocity.
__________________
Arkshine is offline
zombieplague
Veteran Member
Join Date: Apr 2009
Old 06-21-2010 , 11:57   Re: How to detect
Reply With Quote #3

Quote:
Originally Posted by Arkshine View Post
Check his velocity.
Hmmm how ?

Can you show me the code ?
zombieplague is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 06-21-2010 , 12:07   Re: How to detect
Reply With Quote #4

PHP Code:
    new Float:vVel[3];
    
pev(entpev_velocityvVel);
    
    if(
vector_length(vVel) > 0)
        
//moving...(x,y,z) 
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
zombieplague
Veteran Member
Join Date: Apr 2009
Old 06-21-2010 , 12:32   Re: How to detect
Reply With Quote #5

Quote:
Originally Posted by Alka View Post
PHP Code:
    new Float:vVel[3];
    
pev(entpev_velocityvVel);
 
    if(
vector_length(vVel) > 0)
        
//moving...(x,y,z) 
Thanks... But, I need more codes. However, how about not moving ?
zombieplague is offline
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 06-21-2010 , 12:51   Re: How to detect
Reply With Quote #6

Quote:
Originally Posted by zombieplague View Post
Thanks... But, I need more codes. However, how about not moving ?
You just add an °else° block?
mottzi is offline
Send a message via MSN to mottzi
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 06-21-2010 , 12:52   Re: How to detect
Reply With Quote #7

SRY FOR POST....
mottzi is offline
Send a message via MSN to mottzi
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 06-21-2010 , 12:51   Re: How to detect
Reply With Quote #8

PHP Code:
new Float:vVel[3];
    
pev(entpev_velocityvVel);
 
    if(
vector_length(vVel) == 0)
        
//not moving...(x,y,z) 
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
zombieplague
Veteran Member
Join Date: Apr 2009
Old 06-21-2010 , 13:28   Re: How to detect
Reply With Quote #9

Quote:
Originally Posted by drekes View Post
PHP Code:
new Float:vVel[3];
    
pev(entpev_velocityvVel);
 
    if(
vector_length(vVel) == 0)
        
//not moving...(x,y,z) 
Just that ?

How about the public ?

like public somethihng(id ) ??
zombieplague is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 06-21-2010 , 22:43   Re: How to detect
Reply With Quote #10

Quote:
Originally Posted by drekes View Post
PHP Code:
new Float:vVel[3];
    
pev(entpev_velocityvVel);
 
    if(
vector_length(vVel) == 0)
        
//not moving...(x,y,z) 
That's really bad. You should account for epsilon precision, i.e.:

Code:
if ( vector_length( vVel ) <= 0.001 )
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
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 14:49.


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