Raised This Month: $51 Target: $400
 12% 

How to reset a user's max speed?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Geesu
Veteran Member
Join Date: Mar 2004
Location: Cincinnati, OH
Old 11-08-2006 , 11:05   How to reset a user's max speed?
Reply With Quote #1

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
__________________
Need war3ft help? DO NOT PM ME... Check the forums
Geesu is offline
Send a message via AIM to Geesu Send a message via MSN to Geesu
VEN
Veteran Member
Join Date: Jan 2005
Old 11-08-2006 , 12:09   Re: How to reset a user's max speed?
Reply With Quote #2

For all connected clients SetClientMaxspeed to 1.0 and set maxspeed pev according to the current weapon (for example 260.0 for the scout).
VEN is offline
Geesu
Veteran Member
Join Date: Mar 2004
Location: Cincinnati, OH
Old 11-08-2006 , 12:12   Re: How to reset a user's max speed?
Reply With Quote #3

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.
__________________
Need war3ft help? DO NOT PM ME... Check the forums
Geesu is offline
Send a message via AIM to Geesu Send a message via MSN to Geesu
Greenberet
AMX Mod X Beta Tester
Join Date: Apr 2004
Location: Vienna
Old 11-08-2006 , 12:28   Re: How to reset a user's max speed?
Reply With Quote #4

dont think so, but you can save the current maxspeed b4 you set it. to reset just use the stored value
Greenberet is offline
Send a message via ICQ to Greenberet Send a message via MSN to Greenberet
VEN
Veteran Member
Join Date: Jan 2005
Old 11-08-2006 , 12:57   Re: How to reset a user's max speed?
Reply With Quote #5

[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.

Last edited by VEN; 11-08-2006 at 13:13.
VEN is offline
Greenberet
AMX Mod X Beta Tester
Join Date: Apr 2004
Location: Vienna
Old 11-08-2006 , 13:33   Re: How to reset a user's max speed?
Reply With Quote #6

Quote:
Originally Posted by VEN View Post
[edit]
Yes, the only thing that could happen is that other plugin can change the maxpseed value before you get it.
[/edit]
I dont get it...
hl is singlethreaded
Greenberet is offline
Send a message via ICQ to Greenberet Send a message via MSN to Greenberet
VEN
Veteran Member
Join Date: Jan 2005
Old 11-08-2006 , 13:48   Re: How to reset a user's max speed?
Reply With Quote #7

That's exactly why...

Code:
// plugin #1 #include <amxmodx> #include <fakemeta> public plugin_init() {     register_event("CurWeapon", "func", "be", "1=1") } public func(id) {     new Float:maxspeed     pev(id, pev_maxspeed, maxspeed)     server_print("MAXSPEED_1[%f]", maxspeed)     set_pev(id, pev_maxspeed, 123.0) }
Code:
// plugin #2 #include <amxmodx> #include <fakemeta> public plugin_init() {     register_event("CurWeapon", "func", "be", "1=1") } public func(id) {     new Float:maxspeed     pev(id, pev_maxspeed, maxspeed)     server_print("MAXSPEED_2[%f]", maxspeed) }

Code:
/* OUTPUT MAXSPEED_1[250.000000] MAXSPEED_2[123.000000] */
VEN is offline
Greenberet
AMX Mod X Beta Tester
Join Date: Apr 2004
Location: Vienna
Old 11-08-2006 , 17:15   Re: How to reset a user's max speed?
Reply With Quote #8

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.
Greenberet is offline
Send a message via ICQ to Greenberet Send a message via MSN to Greenberet
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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