AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   No movement help (https://forums.alliedmods.net/showthread.php?t=213489)

hLiaS 04-15-2013 09:05

No movement help
 
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

hornet 04-15-2013 09:10

Re: No movement help
 
Check vector length of player velocity. If result is 0.00* then the player is not moving.

.Dare Devil. 04-15-2013 10:30

Re: No movement help
 
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...

didoWEE 04-15-2013 11:37

Re: No movement help
 
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

hornet 04-15-2013 11:51

Re: No movement help
 
Quote:

Originally Posted by didoWEE (Post 1933132)
I think pev(index, pev_buttons) will do the work

Wouldn't work. Otherwise you would go invisible whilst jumping / falling.

baneado 04-15-2013 16:36

Re: No movement help
 
look at bad_camper plugin

ConnorMcLeod 04-15-2013 16:57

Re: No movement help
 
PHP Code:

    new Float:velocity[3], Float:basevelocity[3]
    
pev(idpev_velocityvelocity)
    
pev(idpev_basevelocitybasevelocity)
    if( !
vector_length(velocity) && !vector_length(basevelocity) )
    {
    } 


oxygen935 04-16-2013 12:04

Re: No movement help
 
Quote:

Originally Posted by ConnorMcLeod (Post 1933344)
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...

ConnorMcLeod 04-16-2013 12:35

Re: No movement help
 
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;




oxygen935 04-20-2013 03:38

Re: No movement help
 
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);
}


All times are GMT -4. The time now is 10:57.

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