Thread: [Solved] set_lights in cvar
View Single Post
chickez
Junior Member
Join Date: Jun 2020
Location: Slovakia
Old 06-30-2020 , 06:38   Re: set_lights in cvar
Reply With Quote #12

Quote:
Originally Posted by HamletEagle View Post
PHP Code:
new buffer[size]
get_pcvar_string(cvarbuffercharsmax(buffer))
//do something with buffer 
This is more or less pseudocode, adapt it to your situation. The idea is you do not pass the size of a string manually, you use charsmax() to determine it automatically. This way, you don't pass a wrong value and if you ever change the string size then you do not need to change it in every function that uses it.
I understood. So in this situation, I can set size of string, because It will be one char always.

Other question to this situation. When I change the value of cvar (amxx_lights) in example, to "m" on the server, it will change the light without waiting to next round. How can I do this?
chickez is offline