29.07.2016, 20:18
(
Last edited by Freaksken; 06/08/2016 at 08:50 PM.
)
So, I created this thread in the Scripting Help forums. I'll post the contents of my first post again:
Misiur replied this:
So, here I am reporting the problem.
EDIT:
See also this post in the Useful Functions thread.
EDIT 2:
The server also crashes if a nonexistent console variable is used.
I've updated the wiki page to show that this is a known bug.
Quote:
So I wanted the get the stream_distance set in server.cfg, which is a float value.
Since there is no GetConsoleVarAsFloat function, I've tried the approach found in this thread: click. Code:
stock Float:GetConsoleVarAsFloat(var[]) { new string[30]; GetConsoleVarAsString(var, string, sizeof(string)); //Crash happens here return floatstr(string); } GetConsoleVarAsInt and GetConsoleVarAsBool don't return the correct value obviously. I have this line in my server.cfg file: Code:
stream_distance 300.0 |
Quote:
You've found a bug: using GetConsoleVarAsString on anything other than string (integers, floats), causes segfault. Please report it, and nice find!
|
EDIT:
See also this post in the Useful Functions thread.
EDIT 2:
The server also crashes if a nonexistent console variable is used.
I've updated the wiki page to show that this is a known bug.