Page 1 of 1
es.cexec available in SP??
Posted: Fri Nov 07, 2014 2:32 am
by 8guawong
want to have the script to have client exec cl_use_opens_buy_menu "0"
since CSGO have it so when you are in a buy zone if you press the use button the buy menu pops up

wonder if the following will work...
Syntax: Select all
from engines.server import engine_server
engine_server.client_command(<index>, 'cl_use_opens_buy_menu 0')
FCVAR_SERVER_CAN_EXECUTE prevented server running command: cl_use_opens_buy_menu

Posted: Fri Nov 07, 2014 3:28 am
by satoon101
I don't think we can force players to change client variables. I'm also not sure I would want to play on a server that decided it knew the settings I should use better than I do...
For the question in the topic, yes, you can use engine_server.client_command to execute client commands. Although, I believe that, looking at the code, the first argument is the player's edict_t instance and not their index.
Posted: Fri Nov 07, 2014 3:46 am
by 8guawong
satoon101 wrote:I don't think we can force players to change client variables. I'm also not sure I would want to play on a server that decided it knew the settings I should use better than I do...
For the question in the topic, yes, you can use engine_server.client_command to execute client commands. Although, I believe that, looking at the code, the first argument is the player's edict_t instance and not their index.
yea its edict not index but i just use the example you posted
http://forums.sourcepython.com/showthread.php?642-Forcing-a-player-to-use-a-weapon&p=3452&viewfull=1#post3452
Posted: Fri Nov 07, 2014 5:13 am
by L'In20Cible
Satoon is right, you can only execute commands that are flagged SERVER_CAN_EXECUTE:
Code: Select all
] findflags SERVER_CAN_EXECUTE
"gamepadslot4" client server_can_execute
"disconnect" server_can_execute - Disconnect game from server.
"cam_idealdistup" = "0" client archive server_can_execute
"weapon_reload_database" game cheat server_can_execute - Reload the weapon database
"name" = "L'In20Cible" ( def. "unnamed" ) archive server_can_execute user ss - Current user name
"firstperson" client server_can_execute - Switch to firstperson camera.
"soundfade" server_can_execute - Fade client volume.
"r_drawscreenoverlay" = "1" client cheat server_can_execute
"gamepadslot3" client server_can_execute
"invprev" client server_can_execute
"cancelselect" client server_can_execute
"cam_idealdistright" = "0" client archive server_can_execute
"cam_idealdist" = "150" client archive server_can_execute
"dsp_player" = "0" server_can_execute
"invnext" client server_can_execute
"r_drawunderwateroverlay" = "0" client cheat server_can_execute
"retry" server_can_execute clientcmd_can_execute - Retry connection to last server.
"play" server_can_execute - Play a sound.
"invnextitem" client server_can_execute
"cam_idealyaw" = "0" client archive server_can_execute
"slot10" client server_can_execute
"playgamesound" client server_can_execute clientcmd_can_execute - Play a sound from the game sounds txt file
"cam_idealpitch" = "0" client archive server_can_execute
"gamepadslot5" client server_can_execute
"slot11" client server_can_execute
"buymenu" client server_can_execute - Show or hide main buy menu
"dm_togglerandomweapons" client server_can_execute clientcmd_can_execute - Turns random weapons in deathmatch on/off
"thirdperson" client cheat server_can_execute - Switch to thirdperson camera.
"gamepadslot2" client server_can_execute
"cl_soundscape_flush" client cheat server_can_execute - Flushes the client side soundscapes
"cam_collision" = "1" client archive server_can_execute - When in thirdperson and cam_collision is set to 1, an attempt is made to keep th
"lastinv" client server_can_execute
"gamepadslot6" client server_can_execute
"gamepadslot1" client server_can_execute
"invnextgrenade" client server_can_execute
"echo" server_can_execute - Echo text to console.
"snd_playsounds" client server_can_execute clientcmd_can_execute - Play sounds from the game sounds txt file at a given location
"snd_setsoundparam" client server_can_execute clientcmd_can_execute - Set a sound paramater
"slot1" client server_can_execute
"slot2" client server_can_execute
"slot3" client server_can_execute
"slot4" client server_can_execute
"slot5" client server_can_execute
"slot6" client server_can_execute
"slot7" client server_can_execute
"slot8" client server_can_execute
"slot9" client server_can_execute
"slot0" client server_can_execute
"teammenu" client server_can_execute - Show team selection window
"invnextnongrenade" client server_can_execute
"r_screenoverlay" client cheat server_can_execute - Draw specified material as an overlay
"cl_spec_mode" = "5" ( def. "0" ) client archive server_can_execute user ss - Saves the last viewed spectator mode for use next time we start to spectate
Posted: Fri Nov 07, 2014 10:56 am
by La Muerte
In the list it does say:
"buymenu" client server_can_execute
Posted: Fri Nov 07, 2014 11:02 am
by L'In20Cible
Well, that means you can force the player to open his buymenu but you can't force him to set cl_use_opens_buy_menu to 0.