Doubt about MaxSpeed
I'm using set_user_maxspeed on a plugin but when I set a speed is always the same. Normal speed is 250, but between 250-850 always is the same speed (I mean 251=850, for example)
I used CurWeapon event and someone told me this is a bad method cause is called so many times, yep, and recommend me Ham_Item_PerFrame. I couldn't find anything about this in the forums. What method should I use?
(Now. CurWeapon works, btw if I use a common cvar, maxpeed resets when I change the weapon)
PHP Code:
new cvar_speed
public plugin_init() { //Some stuff cvar_speed = register_cvar("speed", "251") register_event("CurWeapon", "event_speed", "be", "1=1") }
public event_speed(id) { if (!is_user_alive(id)) return static Float: MaxSpeed MaxSpeed = get_pcvar_float(cvar_speed) set_user_maxspeed(id, MaxSpeed) }
|