Trying to get the number of maximum keypads
if (SERVER) then
CreateConVar('sbox_maxkeypads', 10)
end
I tried this but it returns nil:
cvars.Number( "sbox_maxkeypads" )
Then I tried but it also returns nil:
local sbox_maxprops = GetConVar( "sbox_maxkeypads" )
print( sbox_maxprops:GetInt() )
How can I get this convars value? The limit works in the server and I also defined it in my server.cfg but I'm just unable to retrieve a value. My guess is some sort of flag must be set but I'm not sure which one it is from here: FCVAR Enumerations
I am trying to retrieve the value from client side. I also tried setting the FCVAR_REPLICATED flag but no luck there either. Any suggestions?
Well I just did this and it seems to work, but I call the convar both client and server-side
CreateConVar("sbox_maxkeypads", 10, {FCVAR_REPLICATED})
I guess this'll do for now, am I doing this correct or is there a better way?
The second argument of CreateConVar should be a string not a number.
Sorry, you need to Log In to post a reply to this thread.