get_cvar_num(more than one thing in here?)
I'm trying to make my zombie mod work with more bot programs so I took a look at some and changed the minimal bots depending on the real players in game.
I was wondering if i could add more cvars in the get_cvar_num() command so i don't have to make so many new variables. For eg. i wanna do something like PHP Code:
PHP Code:
|
Re: get_cvar_num(more than one thing in here?)
off-topic
Code:
|
Re: get_cvar_num(more than one thing in here?)
switch statement and set the single cvar to multiple values?
|
Re: get_cvar_num(more than one thing in here?)
get_pcvar_string?
|
Re: get_cvar_num(more than one thing in here?)
Quote:
Such as can you show me how to use it as I don't know how to use it what so ever |
Re: get_cvar_num(more than one thing in here?)
Don't listen to him.
You can get/set only cvars and execute commands. You can't get console output after a command has been executed. If bot plugin does not have interface (i mean cvars to read them), you never detect what the value is. By the way, "pb min_bots" - is a command. And after all, you can work with cvars sequentally only: one by one. It a normal and sensible practice of programming. If you wanna minimize your code then store cvar names and commands in array and execute them in loop. |
Re: get_cvar_num(more than one thing in here?)
executing arrays in a loop are extremly CPU exspensive and it is not advised .
http://wiki.amxmodx.org/index.php/Optimizing_Plugins |
Re: get_cvar_num(more than one thing in here?)
Quote:
It's encouraged to use arrays, if you do them properly. |
Re: get_cvar_num(more than one thing in here?)
so you would recomend using an array in a loop ? and whoever wrote that article on wiki is wrong ? :shock:
|
Re: get_cvar_num(more than one thing in here?)
Quote:
I would recommend it, assuming it's implemented correctly. |
| All times are GMT -4. The time now is 06:52. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.