Raised This Month: $ Target: $400
 0% 

Array Get Num From Cvar?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 11-03-2013 , 09:20   Re: Array Get Num From Cvar?
Reply With Quote #3

You'll need to use dynamic arrays for that.

PHP Code:
new Array:g_iArray[33];

public 
plugin_cfg()
{
     for (new 
1maxPlayers get_maxplayers(), cvarValue get_pcvar_num(g_pCvar); <= maxPlayersi++)
        
g_iArray[i] = ArrayCreate(cvarValue);

However it all depends on what you're actually doing. It may be better to just hardcode the array size in certain scenarios.
__________________

Last edited by hleV; 11-03-2013 at 09:23.
hleV 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 23:13.


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