Code: Select all
pl = Player(1)
pl.get_convar_value("lol") # -> 2
# It is important for me to add this function to the Player
# It is important to add that this function is available when the player is fully loaded, otherwise the server will crash.
Code: Select all
from engines.server import engine_server
get_convar_value = lambda index, var_name: engine_server.get_client_convar_value(index, var_name)
print(get_convar_value(1, 'cl_language')) # english
print(get_convar_value(1, 'name')) # Ren
print(get_convar_value(1, 'lol')) # 2 (Because: setinfo lol 2)