North America Premier Soccer League
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Executing RCON commands in ES using Python

3 posters

Go down

Executing RCON commands in ES using Python Empty Executing RCON commands in ES using Python

Post by Stoicblitzer Fri May 11, 2012 3:14 pm

The PSL match server seems to run a highly modified Soccer Mod, so I thought someone might be able to help me. I am trying to change some CVARs when a match starts, but can't figure out the commands in eventscripts that allows this. I just want to change alltalk and set a server pw when a match is started.

I tried putting this in the match start function in match.py and something similar in the stop function. This didn't work. Am I missing something?
Code:

def start(userid):
    player = playerlib.getPlayer(userid)

    if es.ServerVar("sm_cap_fight_started") == 0:
        if es.ServerVar("sm_training_cannon_on") == 0:
            if es.ServerVar("sm_training_goals_disabled") == 0:
                if es.exists("keygroup", "sm_keygroup_vote") == 0:
                    if es.ServerVar("sm_match_started") == 0:
                        # SET PW AND ALLTALK
                        es.forcevalue sv_alltalk 0
                        es.xforcevalue sv_password "pug"

                        freeze()

Stoicblitzer
Site Professional
Site Professional

PSL Awards : N/A
Posts : 176

Back to top Go down

Executing RCON commands in ES using Python Empty Re: Executing RCON commands in ES using Python

Post by Stinger Fri May 11, 2012 4:19 pm

es.queueservercmd ("sv_alltalk 0")
Stinger
Stinger
Site QT
Site QT

PSL Awards : 36 Awards (Click to view)
Posts : 1849

Back to top Go down

Executing RCON commands in ES using Python Empty Re: Executing RCON commands in ES using Python

Post by Stoicblitzer Fri May 11, 2012 5:27 pm

Thanks for putting me on the right track. That is incorrect.

es.server.queuecmd("sv_alltalk 1")

Stoicblitzer
Site Professional
Site Professional

PSL Awards : N/A
Posts : 176

Back to top Go down

Executing RCON commands in ES using Python Empty Re: Executing RCON commands in ES using Python

Post by Stinger Fri May 11, 2012 5:52 pm

Op! Sorry. That was just based off memory, I wasn't on comp to check it. Assuming its all working now?
Stinger
Stinger
Site QT
Site QT

PSL Awards : 36 Awards (Click to view)
Posts : 1849

Back to top Go down

Executing RCON commands in ES using Python Empty Re: Executing RCON commands in ES using Python

Post by Stoicblitzer Fri May 11, 2012 6:50 pm

Yep. It all works now. ty again.

Stoicblitzer
Site Professional
Site Professional

PSL Awards : N/A
Posts : 176

Back to top Go down

Executing RCON commands in ES using Python Empty Re: Executing RCON commands in ES using Python

Post by Furtif Fri May 11, 2012 7:01 pm

what's the ip stoic
Furtif
Furtif
Site Beast
Site Beast

PSL Awards : 5 Award (Click to view)
Posts : 383

Back to top Go down

Executing RCON commands in ES using Python Empty Re: Executing RCON commands in ES using Python

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum