AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Convert cvar in number (https://forums.alliedmods.net/showthread.php?t=147461)

.MMYTH. 01-09-2011 14:20

Convert cvar in number
 
I want to convert a cvar into a number, to service an array:

PHP Code:

new g_maxcaracter

public plugin_init()
{
    
g_maxcaracter register_cvar("maxcaracteres""100")
}

public 
abc(id)
{
    new 
argv[get_pcvar_num(g_maxcaracter)]


But don't compile, I test with sizeof, str_to_num and nothing...
If somemone can help me...

Arkshine 01-09-2011 14:22

Re: Convert cvar in number
 
You can't do that. It needs a constant value. You can do that only with the dynamic arrays.

.MMYTH. 01-09-2011 14:23

Re: Convert cvar in number
 
OK, thanks...


All times are GMT -4. The time now is 01:58.

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