Raised This Month: $ Target: $400
 0% 

No movement help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hLiaS
Senior Member
Join Date: Aug 2011
Location: In My Holly Dreams
Old 04-15-2013 , 09:05   No movement help
Reply With Quote #1

How can i check if a user stays with no movement??
You know what i mean?? I want if a user don't do any movement then adds invinsibility

Last edited by hLiaS; 04-15-2013 at 09:05.
hLiaS is offline
Send a message via Skype™ to hLiaS
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 04-15-2013 , 09:10   Re: No movement help
Reply With Quote #2

Check vector length of player velocity. If result is 0.00* then the player is not moving.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 04-15-2013 , 10:30   Re: No movement help
Reply With Quote #3

static Float:v[3]
pev( id, pev_velocity, v )
if( v[0] == 0.0 && v[1] == 0.0 && v[2] == 0.0 ) // no movement
If player spawn set loop tast to check this...

Last edited by .Dare Devil.; 04-15-2013 at 10:31.
.Dare Devil. is offline
didoWEE
Senior Member
Join Date: Oct 2012
Location: Bulgaria
Old 04-15-2013 , 11:37   Re: No movement help
Reply With Quote #4

Hmm, sometimes this is false. On some maps, there is water which moves the players (e.g. like in deathrun maps)

I think pev(index, pev_buttons) will do the work

Last edited by didoWEE; 04-15-2013 at 11:44.
didoWEE is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 04-15-2013 , 11:51   Re: No movement help
Reply With Quote #5

Quote:
Originally Posted by didoWEE View Post
I think pev(index, pev_buttons) will do the work
Wouldn't work. Otherwise you would go invisible whilst jumping / falling.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
baneado
Veteran Member
Join Date: Dec 2012
Location: amxmodx-es.com
Old 04-15-2013 , 16:36   Re: No movement help
Reply With Quote #6

look at bad_camper plugin
baneado is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-15-2013 , 16:57   Re: No movement help
Reply With Quote #7

PHP Code:
    new Float:velocity[3], Float:basevelocity[3]
    
pev(idpev_velocityvelocity)
    
pev(idpev_basevelocitybasevelocity)
    if( !
vector_length(velocity) && !vector_length(basevelocity) )
    {
    } 
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
oxygen935
Veteran Member
Join Date: Jun 2012
Location: Athens, Greece
Old 04-16-2013 , 12:04   Re: No movement help
Reply With Quote #8

Quote:
Originally Posted by ConnorMcLeod View Post
PHP Code:
    new Float:velocity[3], Float:basevelocity[3]
    
pev(idpev_velocityvelocity)
    
pev(idpev_basevelocitybasevelocity)
    if( !
vector_length(velocity) && !vector_length(basevelocity) )
    {
    } 
connor i need this too, i tried that but it's not working...
__________________
Quote:
Originally Posted by quark View Post
You're a genius
Stopped any pawn work cause of university for computer science
oxygen935 is offline
Send a message via Skype™ to oxygen935
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-16-2013 , 12:35   Re: No movement help
Reply With Quote #9

You can also try this :

basevelocity is applied when players stands on conveyor.

PHP Code:
is_user_movingid )
{
    new 
Float:velocity[3];
    
pev(idpev_velocityvelocity);
    if( 
vector_length(velocity) )
    {
        return 
1;
    }

    if( 
pev(idpev_flags) & FL_BASEVELOCITY )
    {
        
pev(idpev_basevelocityvelocity);
        if( 
vector_length(velocity) )
        {
            return 
1;
        }
    }

    return 
0;


__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
oxygen935
Veteran Member
Join Date: Jun 2012
Location: Athens, Greece
Old 04-20-2013 , 03:38   Re: No movement help
Reply With Quote #10

connor again not working...
P.S i use this:
Quote:
if(!is_user_moving(id))
{
set_user_rendering(id, kRenderFxGlowShell, 0,0,0, kRenderTransAlpha, 0);
}
__________________
Quote:
Originally Posted by quark View Post
You're a genius
Stopped any pawn work cause of university for computer science
oxygen935 is offline
Send a message via Skype™ to oxygen935
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 10:57.


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