Raised This Month: $ Target: $400
 0% 

Check if someone isn't moving.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 08-11-2012 , 12:00   Check if someone isn't moving.
Reply With Quote #1

How do i check if someone isn't moving, if so set him invisible. From when he's moving again, i want to reset the invisibility
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-11-2012 , 12:05   Re: Check if someone isn't moving.
Reply With Quote #2

Check his velocity.
__________________
Arkshine is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 08-11-2012 , 12:33   Re: Check if someone isn't moving.
Reply With Quote #3

is there a tutorial on velocity usements?
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-11-2012 , 12:38   Re: Check if someone isn't moving.
Reply With Quote #4

PHP Code:
#include <fakemeta>

new Float:fVelocity];
pevid pev_velocity fVelocity ); 
Check the 3 values.
__________________

Last edited by Bugsy; 08-11-2012 at 12:38.
Bugsy is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 08-11-2012 , 12:39   Re: Check if someone isn't moving.
Reply With Quote #5

which function should i use for this? Cmd_Start?
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-11-2012 , 12:48   Re: Check if someone isn't moving.
Reply With Quote #6

Sure, you could check for buttons there and then check velocity:
PHP Code:
#define IN_JUMP                         (1<<1)
#define IN_FORWARD                      (1<<3)
#define IN_BACK                         (1<<4)
#define IN_MOVELEFT                     (1<<9)
#define IN_MOVERIGHT                    (1<<10) 
__________________
Bugsy is offline
Old 08-11-2012, 12:48
Backstabnoob
This message has been deleted by Backstabnoob. Reason: too late
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-11-2012 , 13:00   Re: Check if someone isn't moving.
Reply With Quote #7

Player can move without holding a key (falling, end of run, jump, ...)

About where to check, it more depends on what you want to do exactly.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 08-11-2012 at 13:05.
ConnorMcLeod is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-11-2012 , 13:07   Re: Check if someone isn't moving.
Reply With Quote #8

You can check it whenever you want. If you put it in a function that is not called often then they will be able to move and remain visible for between executions of the code. If you want to have them become visible immediately when they move then you need to use a function that is called very often.

Quote:
Originally Posted by Napoleon_be View Post
is there a tutorial on velocity usements?
What kind of word is that?
__________________
fysiks is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-11-2012 , 13:19   Re: Check if someone isn't moving.
Reply With Quote #9

Oh, you want to set invisible, i think you could use a 0.1 looping task, would be enough, no one could bypass this
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 08-11-2012 , 19:11   Re: Check if someone isn't moving.
Reply With Quote #10

Quote:
Originally Posted by ConnorMcLeod View Post
Oh, you want to set invisible, i think you could use a 0.1 looping task, would be enough, no one could bypass this
So i can set this task in plugin_init or? Is it better to use ham_spawn?
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
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 05:43.


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