es.cexec available in SP??

Please post any questions about developing your plugin here. Please use the search function before posting!
8guawong
Senior Member
Posts: 148
Joined: Sat Sep 20, 2014 3:06 am

es.cexec available in SP??

Postby 8guawong » Fri Nov 07, 2014 2:32 am

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 :rolleyes:

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

:frown: :frown: :frown:
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Fri Nov 07, 2014 3:28 am

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.
Image
8guawong
Senior Member
Posts: 148
Joined: Sat Sep 20, 2014 3:06 am

Postby 8guawong » Fri Nov 07, 2014 3:46 am

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

:cool:
User avatar
L'In20Cible
Project Leader
Posts: 1533
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Postby L'In20Cible » Fri Nov 07, 2014 5:13 am

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
User avatar
La Muerte
Administrator
Posts: 180
Joined: Sun Jul 15, 2012 1:48 pm
Location: Belgium
Contact:

Postby La Muerte » Fri Nov 07, 2014 10:56 am

In the list it does say:
"buymenu" client server_can_execute
User avatar
L'In20Cible
Project Leader
Posts: 1533
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Postby L'In20Cible » Fri Nov 07, 2014 11:02 am

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.

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 145 guests