Raised This Month: $ Target: $400
 0% 

Hooking the event, when clients maxspeed is changed


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 12-30-2010 , 07:47   Hooking the event, when clients maxspeed is changed
Reply With Quote #1

So as the title says, it there any event which i can hook when a players maxspeed is changed

I tried the following method but it doesnt worked:
Code:
#include <amxmodx> #include <fakemeta> #include <hamsandwich> public plugin_init() register_clcmd( "say test" , "hook" )     RegisterHam(Ham_Item_PreFrame, "player", "item" ) public item(id) client_print(0,print_chat,"Item Frame Called on player: %d", id) public hook(id) {     client_print(id,print_center,"speed set to 800.0")     set_pev(id, pev_maxspeed, 800.0) }
The forward is only called when i try to change my weapon, and it is not called when i manually set the max speed to 800.0 using the "say test" command so is there any other forward/event through which i can be sure that the clients maxspeed was changed
__________________

My Plugins For ZP

Inactive due to College and Studies

Last edited by abdul-rehman; 12-30-2010 at 08:54.
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 12-30-2010 , 11:00   Re: Hooking the event, when clients maxspeed is changed
Reply With Quote #2

That's not the correctly way for changing player's max speed, I believe that you saw that in ZP lol. Use set_user_maxspeed for chaging player's max speed in a single frame, and 4ever.
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 12-30-2010 , 12:24   Re: Hooking the event, when clients maxspeed is changed
Reply With Quote #3

Quote:
Originally Posted by meTaLiCroSS View Post
That's not the correctly way for changing player's max speed, I believe that you saw that in ZP lol. Use set_user_maxspeed for chaging player's max speed in a single frame, and 4ever.
If i set the speed in Ham_Item_PreFrame then probably, Ham_Item_PreFrame will be called again ??
So this means it will form an infinite loop in which Ham_Item_PreFrame will be called and then i will change the speed and then it will again be called and so it will go on,
So isnt it better to set the speed in a 0.1 second task with a "b" flag ?
__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 12-30-2010 , 23:20   Re: Hooking the event, when clients maxspeed is changed
Reply With Quote #4

Quote:
Originally Posted by abdul-rehman View Post
If i set the speed in Ham_Item_PreFrame then probably, Ham_Item_PreFrame will be called again ??
So this means it will form an infinite loop in which Ham_Item_PreFrame will be called and then i will change the speed and then it will again be called and so it will go on,
So isnt it better to set the speed in a 0.1 second task with a "b" flag ?
1. No
2. See #1.
3. Never.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
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 06:05.


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