Setting a client's maxspeed permanently and efficiently
I'm trying to reach the best method of setting a client's maxspeed without hooking a "constant forward". To 1.0 (to block him)
I don't like to hook events (but it's still better than ClientCmdStart or PreThink) so, I tried to use ham hooks and also to hook FM_SetClientMaxspeed but, that didn't work so, i'm sticking with something like: PHP Code:
Now I want to be able to reset the maxspeed accordingly to the carrier's weapon. I tried executing Ham_CS_Item_GetMaxSpeed but it returns 0.0 for the weapons I tested. So my questions are: Do you have a better way to handle the setting situation? There is a way of getting the maxspeed related to a weapon without having it in the code? ___ A funny thing that happened to me during this process was that I tried Ham_CS_Item_GetMaxSpeed passing it a player, like: PHP Code:
[IMG]http://img195.**************/img195/3701/deinferno0007c.th.jpg[/IMG] So I guess that the offset that hamsandwich is using for Ham_CS_Item_GetMaxSpeed is instead for another function |
Re: Setting a client's maxspeed permanently efficiently
Quote:
|
Re: Setting a client's maxspeed permanently efficiently
Quote:
Edit: look: PHP Code:
Code:
Max speed 123.123001 |
Re: Setting a client's maxspeed permanently efficiently
Quote:
|
Re: Setting a client's maxspeed permanently and efficiently
For entity id, you do it right.
To set player maxspeed : PHP Code:
Last solution is to filter CurWeapon to determinate when a player switch weapon. Basically something like this should be enough : PHP Code:
PHP Code:
|
Re: Setting a client's maxspeed permanently and efficiently
I tried to hook Item_Deploy post and it happens before the maxspeed setting so that doesn't work.
I'm giving now a try to the rest of what you said. I guess you have solved this. |
Re: Setting a client's maxspeed permanently and efficiently
Ok. Both of Connor's suggestions work. I'm sticking with:
PHP Code:
|
Re: Setting a client's maxspeed permanently and efficiently
Quote:
|
Re: Setting a client's maxspeed permanently and efficiently
I found a way that should be the most efficient of doing this job (Set a usermaxspeed permanently)
Its about adding a new "offset" to hamdata.ini related to the function <ResetMaxSpeed__11CBasePlayer> I found it by doing some experiment and by having some luck since i'm a newbie in those matters. The way, without changing hamsandwich code: PHP Code:
player_shouldfadeondeath 69 in windows player_shouldfadeondeath 71 in linux, i guess but i haven't tried it. |
Re: Setting a client's maxspeed permanently and efficiently
Good job to find that.
|
| All times are GMT -4. The time now is 13:49. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.