AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   IN_RUN button wont work (https://forums.alliedmods.net/showthread.php?t=217522)

.Dare Devil. 06-03-2013 16:59

IN_RUN button wont work
 
Hello Allied Modders!
im having troubles hooking IN_RUN

Code:
PHP Code:

pn_print1"gaitsequence:%d/3 forward:%d run:%d"pevidpev_gaitsequence ), (pev(idpev_button) & IN_FORWARD), (pev(idpev_button) & IN_RUN)  ) 

run is always 0, forward is working fine...
code runs in engine client_postthink.
Any solutions?

And as always, thanks!

TheDS1337 06-03-2013 17:13

Re: IN_RUN button wont work
 
Try make a global variable and use it in client_postthink:
Code:

new g_InForward;
new g_InRun;

public client_postthink( Client )
{
        g_InForward = pev( Client, pev_button ) & IN_FORWARD;
        g_InRun = pev( Client, pev_button ) & IN_RUN;
}


.Dare Devil. 06-03-2013 17:28

Re: IN_RUN button wont work
 
Quote:

Originally Posted by DeagLe.Studio (Post 1963959)
Try make a global variable and use it in client_postthink:
Code:

new g_InForward;
new g_InRun;

public client_postthink( Client )
{
        g_InForward = pev( Client, pev_button ) & IN_FORWARD;
        g_InRun = pev( Client, pev_button ) & IN_RUN;
}


youre serious? :):):)

TheDS1337 06-03-2013 17:29

Re: IN_RUN button wont work
 
Quote:

Originally Posted by .Dare Devil. (Post 1963968)
youre serious? :):):)

Not yet, i am noob :stupid::stupid::stupid:

.Dare Devil. 06-03-2013 17:31

Re: IN_RUN button wont work
 
Quote:

Originally Posted by DeagLe.Studio (Post 1963969)
Not yet, i am noob :stupid::stupid::stupid:

Its the same what i did... :)

TheDS1337 06-03-2013 17:33

Re: IN_RUN button wont work
 
Quote:

Originally Posted by .Dare Devil. (Post 1963971)
Its the same what i did... :)

Sorry then :D

.Dare Devil. 06-03-2013 17:36

Re: IN_RUN button wont work
 
Doing some research i found that IN_RUN is not working at all and my problem is normal.
My question is that is there anyway to check walk button with pev_maxspeed 1.0 or less?
Even when client is not pressing forward or back or side buttons it will catch walk, ive found already on way here: http://forums.alliedmods.net/showthr...hlight=walking
but this only work when player is pressing anyohter speed button not only walk.

TheDS1337 06-03-2013 18:01

Re: IN_RUN button wont work
 
Maybe some think like that works, btw i go sleep good night :)
Code:

static Float:Velocity[ 3 ];
pev( Client, pev_velocity, Velocity );
if( vector_lenght( Velocity ) > 250.0 )
        client_print( Client, print_center, "WALKING" );
else
        client_print( Client, print_center, "RUNNING" );



All times are GMT -4. The time now is 16:21.

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