AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Prethink velocity (https://forums.alliedmods.net/showthread.php?t=76755)

Prajch 08-29-2008 19:26

Prethink velocity
 
If I give someone an upward velocity during their prethink, will they still be touching the ground on their next prethink (i.e. does the velocity immediately cause a displacement or does it take a full "frame" before they move)?

Exolent[jNr] 08-29-2008 19:44

Re: Prethink velocity
 
Why don't you test and find out?

Prajch 08-29-2008 19:58

Re: Prethink velocity
 
Because I've been trying to for the last several hours...

Exolent[jNr] 08-29-2008 20:11

Re: Prethink velocity
 
Code:
#include <amxmodx> #include <fakemeta> new bool:g_up[33]; public plugin_init() {     register_plugin("PreThink Velocity Test", "0.1", "Exolent");         register_forward(FM_PlayerPreThink, "FwdPlayerPreThink"); } public client_connect(client) {     g_up[client] = false; } public FwdPlayerPreThink(client) {     if( !is_user_alive(client) ) return;         new Float:velocity[3];     pev(client, pev_velocity, velocity);         if( velocity[2] <= 0.0 && g_up[client] )     {         // client just now starts to fall after rising         g_up[client] = false;     }     else if( velocity[2] > 0.0 && !g_up[client] )     {         // client just now starts to rise         g_up[client] = true;                 if( pev(client, pev_flags) & FL_ONGROUND )         {             client_print(client, print_chat, "You are moving up while on the ground");         }         else         {             client_print(client, print_chat, "You are moving up and not on the ground");         }     } }

Prajch 08-30-2008 04:38

Re: Prethink velocity
 
Thanks for the code. Apparently the problem I'm having has nothing to do with that though, oh well... I'd give you karma but it says I can't anymore.


All times are GMT -4. The time now is 03:13.

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