Raised This Month: $ Target: $400
 0% 

g[s]et_cvar and g[s]et_pcvar


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
l4ulwtlln
Member
Join Date: Aug 2007
Old 11-03-2007 , 22:13   Re: g[s]et_cvar and g[s]et_pcvar
Reply With Quote #1

yes i know it is faster but for that speed you are sacrificing memory, or at least that is what ive read.


okay lets put it this way.
i kno that if u use it for multiple functions then pcvar is the way to go but is it better than using cvar with 1 function?




which example is better?:
PHP Code:
new test_pcvar

public plugin_init()
{
    
register_plugin("test""""")
    
test_pcvar register_cvar("amx_test_cvar""1")
}

public 
client_putinserver(id)
{
    if (
get_pcvar_num(test_pcvar))
        
client_print(0print_chat"test")

or

PHP Code:
public plugin_init()
{
    
register_plugin("test""""")
    
register_cvar("amx_test_cvar""1")
}

public 
client_putinserver(id)
{
    if (
get_cvar_num("amx_test_cvar"))
        
client_print(0print_chat"test")


Last edited by l4ulwtlln; 11-03-2007 at 22:17.
l4ulwtlln 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 01:21.


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