How to reset a user's max speed?
How do you reset a user's maxspeed so the engine will automatically determine what the speed should be?
I know it is reset at round start, but if mid-round I want to reset it how can I do this? And it's not set_user_maxspeed( id ); Passing -1 as the argument makes the user stuck in place and cannot move. I'm worried there isn't a number you can set it too and it relates to the (*g_engfuncs.pfnSetClientMaxspeed) call within fun.cpp. There is no comparable pfnGetClientMaxspeed (yes I know you can get it from v.maxspeed but this might be stored in a separate place). Any ideas? Thanks, Josh |
Re: How to reset a user's max speed?
For all connected clients SetClientMaxspeed to 1.0 and set maxspeed pev according to the current weapon (for example 260.0 for the scout).
|
Re: How to reset a user's max speed?
Is there any way to reset without knowing the users current weapon?
I just wish there was literally a reset function so the engine would start handling... Something Ive just found is that you can force a weapon change on the client and the speed will be reset. |
Re: How to reset a user's max speed?
dont think so, but you can save the current maxspeed b4 you set it. to reset just use the stored value
|
Re: How to reset a user's max speed?
[edit]
Yes, the only thing that could happen is that other plugin can change the maxpseed value before you get it. [/edit] If you don't want to use weapons speeds array to set the speed for the corresponding weapon (why?), you can, for example, emulate double "lastinv" cmd but i wouldn't do that because player can have only one weapon and this will not work. Also it's a bit hackish. You could also just "wait" until weapon change. But again - using weapons speeds array is the most appropriate way. If you don't want to create it yourself, use search, i saw it somewhere on the forums. |
Re: How to reset a user's max speed?
Quote:
hl is singlethreaded |
Re: How to reset a user's max speed?
That's exactly why...
Code:
Code:
Code:
|
Re: How to reset a user's max speed?
now i get what you mean^^
i thought you mean that plugin A interrupts plugin B like threads. but yeah in this case you would get the wrong value. |
| All times are GMT -4. The time now is 20:17. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.