Code Monkey home page Code Monkey logo

sam3-xml-event-admin's Introduction

sam3-xml-event-admin

Administrate your Serious Sam 3 server through in-game chat

What it does

sam3-xml-event-admin is a simple Lua script that listens for XML_Log events on your Serious Sam 3 dedicated server and runs certains actions on them. It examines <chat> messages for server commands and uses the <playerjoined> and <playerleft> XML messages to keep track of connected players. By typing a pre-defined command into the in-game chat you can perform various actions like changing the map or kicking a player.

How to use it and available commands

Just open the chat (default 'y') and enter a command (prefixed with a dot). The following ones are currently implemented:

  • .kick - calls gamKickByIndex() or gamKickByName() depending on whether .kick is followed by digits or a string. Examples: .kick 7 kicks player with index 7 (see gamListPlayers() for the actual index number), .kick hans kicks the player whose name begins with hans (case doesn't matter), e.g. Hans or hanswurst.

  • .ban - calls gameBanByIndex() or gameBanByName, see above for details, and additionally kicks targeted player.

  • .pass - calls samVotePass() - forces the current vote to pass

  • .fail - calls samVoteFail() - forces the current vote to fail

  • .nextmap - calls samNextMap - instantly changes to the next map in the active mapcycle

  • .restart map- calls samRestartMap() - restarts the current map (without disconnecting players)

  • .restart game - calls gamRestartGame() - restarts the current game (without disconnecting players)

  • .restart server - calls gamRestartServer() - restarts the server and drops all connections

  • .start - calls gamStart()- starts the game

  • .stop - calls gamStop() - stops the current game

  • .pause - calls samPauseGame() - pauses and unpauses the game

Installation

Copy the script to your Content/SeriousSam3/Scripts/Startup/ directory, it will get automatically executed on server startup.

For the in-gaem chat commands to work, you will have to define at least one administrative user. By default, the variable globals.ser_strAdminList is used for this purpose. Its value is the hexadecimal representation of one or more steamID64, you can find these in the game's console/log or by running, e.g.

printf "%x\n" 76561197964423629

Simply define the variable in a file that gets executed on server startup, e.g. your server.cfg:

globals.ser_strAdminList = "1100001003f71cd;1100001066b41df;"

sam3-xml-event-admin's People

Contributors

hypercephalickitten avatar

Watchers

 avatar  avatar

Forkers

magister-pd2or

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.