Sends out notifications over a TCP Socket on the following events:
- Player connected to the server
- Player joined the game
- Player left the game
To successfully use the plugin you need the following components:
- HLDS Server
- cstrike game
- AMX Mod X 1.8.2
- TCP Socket listener
- Compile the plugin
- Copy compiled plugin into your
cstrike/cstrike/addons/amxmodx/plugins
directory - Start TCP Socket server on tcp4:127.0.0.1:28000
- Restart HLDS Server
Package scheme: EVENT
\tDATASET
\n
Dataset scheme: FIELD1
\tFIELD2
\tFIELD4
\tFIELDn
\t
Event | Fields | 1 | 2 | 3 | 4 |
---|---|---|---|---|---|
CONNECT | 3 | PlayerID | SteamID | PlayerName | N/A |
ENTER | 4 | PlayerID | SteamID | PlayerTeam | PlayerName |
LEAVE | 4 | PlayerID | SteamID | PlayerTeam | PlayerName |
Overall process:
- HLDS Server is running
- AMX Mod X is enabled
- AMX Mod X has Join Alert plugin enabled
- Cstrike game goes on
- A player connects to the server
- Plugin triggers CONNECT event
- A player picks a team to join and joins it
- Plugin triggers ENTER event
- A player gets tired and leaves the game
- Plugin triggers LEAVE event
Event triggering process:
- Something happens
- HLDS/cstrike triggers an event
- AMX Mod X receives that event
- AMX Mod X triggers corresponging event for plugins
- Plugin handles event with a function
Package sending process:
- Nothing is happening, no sockets are open
- An event happens
- Plugin handler function being executed
- Hahdler function triggers
say_to_socket2()
function say_to_socket2()
function makes an attempt to open a TCP socketsay_to_socket2()
function verifies if the socket was successfully opened- If fails opening a socket, error is written to HLDS console and
bool:false
returned - If no errors appeared, a message is being sent over the opened socket and then the socket is being closed
Here goes a number of explained event and package contents examples.
- Player MrBean connected to the server:
CONNECT 9 STEAM_0:2:90009000 MrBean
- Player MrBean chose to play as a CT:
ENTER 9 STEAM_0:2:90009000 C MrBean
- Player MrBean finally left the game:
LEAVE 9 STEAM_0:2:90009000 C MrBean
[hlds@cs16server ~]$ nc -tl4 127.0.0.1 28000
CONNECT 9 STEAM_0:2:90009000 MrBean
ENTER 9 STEAM_0:2:90009000 C MrBean
LEAVE 9 STEAM_0:2:90009000 C MrBean