Raised This Month: $ Target: $400
 0% 

Doubt about MaxSpeed


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
KuvZz
Member
Join Date: Sep 2013
Location: Spain
Old 10-02-2015 , 12:20   Doubt about MaxSpeed
Reply With Quote #1

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 
FloatMaxSpeed
    MaxSpeed 
get_pcvar_float(cvar_speed)
    
    
set_user_maxspeed(idMaxSpeed)

__________________

Last edited by KuvZz; 10-02-2015 at 12:29.
KuvZz is offline
 



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 22:10.


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