Skip to content
View in the app

A better way to browse. Learn more.

Learn more

soccer-ball-statistics/README.txt

README.txt
52 lines · 2.5 KB · Text
Raw
Soccer Ball Statistics 1.0.0 (olds.ro)
======================================

SoccerJam: counts every player's ball touches, goals and assists, saves them
in a database by SteamID and shows a top list in game.

Requirements
  - AMX Mod X 1.10.0.5490 or newer, engine, sqlx (MySQL or SQLite), nvault
  - a SoccerJam mod whose ball and goal nets have the classnames below

Install
  1. Compile scripting/olds_ballstats.sma and copy olds_ballstats.amxx to
     addons/amxmodx/plugins/.
  2. Copy data/lang/olds_ballstats.txt to addons/amxmodx/data/lang/.
  3. Set the database cvars. The table olds_ball_stats is made on first run:
       steamid (key), name, goals, assists, touches
  No downloads: a MOTD table and chat lines.

Settings (addons/amxmodx/configs/plugins/olds_ballstats.cfg, made on first run)
  olds_bs_driver mysql           mysql or sqlite
  olds_bs_host 127.0.0.1         database host (protected)
  olds_bs_user / olds_bs_pass    database login (protected)
  olds_bs_db amxx                database (sqlite: the file in data/sqlite3)
  olds_bs_saveint 60             seconds between saves
  olds_bs_key 0                  player key: 0 SteamID, 1 name (LAN servers)
  olds_bs_ball PwnBall           classname of the ball
  olds_bs_net soccerjam_goalnet  classname of the goal nets

Players
  say /ballstats   your goals, assists and touches
  say /balltop     the top 10 scorers (MOTD), by goals then assists

Admins
  amx_ballstats (ADMIN_KICK)   everyone's counts, what is saved, what waits
                               in the nVault, the database state
  amx_ballsave (ADMIN_CFG)     save now

How it works
  - SoccerJam scores when its ball touches a goal net; the plugin watches
    the same touches (engine register_touch). The ball touching a player is
    a touch (one per contact); touching a net is a goal for the last player
    who touched it. The assist goes to the scorer's team mate who touched
    the ball just before him. A goal starts a new chain; the net is ignored
    for 3 s after a goal.
  - Saving uses threaded queries (SQL_ThreadQuery): each player's new
    counts are added to his row (INSERT IGNORE, then UPDATE ... + n), every
    olds_bs_saveint seconds, when he leaves and on demand.
  - When the database does not answer, one warning is logged and the counts
    go to the nVault "olds_ballstats"; they are merged into the table as
    soon as it answers (checked every olds_bs_saveint, at map start and when
    the player joins). At map end the unsaved counts go to the vault first,
    so a map change while a query is pending loses nothing.

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.