AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   prethink: How to check certain movements (https://forums.alliedmods.net/showthread.php?t=50855)

SweatyBanana 02-05-2007 10:53

prethink: How to check certain movements
 
Hey.. I need to know how to check if a user is turning left, right, up, or down.

Thanks for the help.

dutchmeat 02-05-2007 10:58

Re: prethink: How to check certain movements
 
what do you mean by turning left?
strafing left, aiming to left ?

SweatyBanana 02-05-2007 11:37

Re: prethink: How to check certain movements
 
Quote:

Originally Posted by dutchmeat (Post 435647)
what do you mean by turning left?
strafing left, aiming to left ?

Such as your mouse movement..

This is for amx_apache.. I want to add pitch and roll with mouse movement..

dutchmeat 02-05-2007 12:23

Re: prethink: How to check certain movements
 
I've used this simple, but effective way of increasing roll and pitch:
Code:
    client_cmd(a,"m_yaw 0.015")  //WHILE SWOOPING DECREASE YAW AND PITCH     client_cmd(a,"m_pitch 0.015")

but you could use these pev's (FM cons):

Code:
 pev_pitch_speed,  pev_yaw_speed,

or the engine's:
Code:
 EV_FL_pitch_speed,  EV_FL_yaw_speed,

XxAvalanchexX 02-05-2007 20:40

Re: prethink: How to check certain movements
 
Code:
 #include <amxmodx>  #include <engine>  new Float:oldAngles[33][3];  public client_PreThink(id)  {     static Float:angles[3];     entity_get_vector(id,EV_VEC_v_angle,angles);     if(angles[0] < oldAngles[id][0])     {         client_print(id,print_chat,"UP");     }     else if(angles[0] > oldAngles[id][0])     {         client_print(id,print_chat,"DOWN");     }     if(angles[1] < oldAngles[id][1])     {         client_print(id,print_chat,"RIGHT");     }     else if(angles[1] > oldAngles[id][1])     {         client_print(id,print_chat,"LEFT");     }     oldAngles[id] = angles;  }

However, you'll have to figure out how to account for when angles wrap around.


All times are GMT -4. The time now is 00:40.

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