Page 1 of 1

[Q/DEV] UserInfo method

Posted: Mon Jan 20, 2020 11:30 am
by Sam
Maybe you should add this?

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)

Re: [Q/DEV] UserInfo method

Posted: Mon Feb 24, 2020 8:48 pm
by Ayuto

Re: [Q/DEV] UserInfo method

Posted: Tue Feb 25, 2020 9:23 am
by Sam
Ayuto wrote:Just added the wrapper function:
https://github.com/Source-Python-Dev-Te ... f380543fa0


It's not bad. It's good!