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

getting cvar string/num, which is faster?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Desikac
Senior Member
Join Date: Apr 2010
Location: Serbia
Old 08-29-2011 , 06:20   Re: getting cvar string/num, which is faster?
Reply With Quote #8

Quote:
Originally Posted by OvidiuS View Post
he has around 22 cvars xD
anything more adjustable?
25
Is this a good method (to handle 25 cvars)?
PHP Code:
#include <amxmodx>

new cvars[25]

public 
plugin_init() {
    
cvars[0] = register_cvar("mycvar""1")
    
cvars[1] = register_cvar("mycvar2""8")
    
cvars[2] = register_cvar("mycvar3""55")
    
cvars[3] = register_cvar("mycvar4""dsa")
    
cvars[4] = register_cvar("mycvar5""0")
    
cvars[5] = register_cvar("mycvar6""4")
// ...
    
cvars[24] = register_cvar("mycvar25""qwerty")
}

public 
get_values() {
    new 
sVal[32]
    
get_pcvar_string(cvars[3], sValcharsmax(sVal))
    
    new 
iVal get_pcvar_num(cvars[5])

Desikac is offline
Send a message via MSN to Desikac Send a message via Skype™ to Desikac
 



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 19:39.


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