JM-NPCRoadRage includes an optional database integration. Without it, every feature works normally — only the /npcrage-history command will return empty results.
Table Schema#
The included database.sql file creates one table:
npc_road_rage_incidents id INT (auto-increment primary key) citizenid VARCHAR(50) coords TEXT weapon_used VARCHAR(50) police_notified TINYINT(1) timestamp INT created_at TIMESTAMPImporting the Schema#
Run the SQL file against your server database once:
mysql -u YOUR_USER -p YOUR_DATABASE < /path/to/JM-NPCRoadRage/database.sqlOr import it via phpMyAdmin or HeidiSQL using the Import option.
Enabling Database Logging#
Database writes are present in the resource but commented out by default. To activate them you would need to uncomment the oxmysql execute calls inside server/database.lua. The resource uses oxmysql syntax — make sure that resource is running on your server.
The database.sql file is safe to import multiple times — it uses CREATE TABLE IF NOT EXISTS so it will not overwrite existing data.
What Gets Logged#
Each road rage incident can record:
- The citizen ID of the player involved.
- The coordinates where the incident occurred.
- The weapon used by the NPC (or
nonefor fists). - Whether police were notified.
- A Unix timestamp of the event.