-
Notifications
You must be signed in to change notification settings - Fork 0
open.mp Basics
If you've never made a multiplayer GTA server, this page explains the words used everywhere else in this wiki. If you already run open.mp/SA-MP servers, skip to Quick Start.
open.mp (open multiplayer) is a free server for GTA: San Andreas multiplayer — the successor to SA-MP. You run a server, players connect with the GTA SA client, and your code controls the game (spawns, money, cars, admin commands, etc.).
Pawn — a small, C-like scripting language. Your server logic lives in .pwn
files that you compile into .amx files (the compiled form the server runs).
your_code.pwn --(compile with pawncc)--> your_code.amx --(server runs this)
- Gamemode — the main script that defines your server (e.g. a roleplay or deathmatch mode). One runs at a time.
- Filterscript — a small add-on script that runs alongside the gamemode (e.g. an admin system, a teleport menu). You can load several.
omp-MySQL works in both. The shipped mysql-admin is a filterscript so you can drop it onto any server.
- In SA-MP, native C/C++ add-ons were called plugins.
- In open.mp, they're components and use a modern SDK. They go in the
components/folder.
omp-MySQL is a component. It adds the mysql_* functions your Pawn code calls.
A native is a function provided by a component/the server that your Pawn code can
call — like mysql_connect(...) or SendClientMessage(...). The list of omp-MySQL's
natives is the Native reference.
A function the server/component calls for you when something happens, e.g.
OnPlayerConnect(playerid) (a player joined) or your own OnLogin(playerid) (a query
finished). You write the body; the engine calls it at the right time.
your-server/
├─ omp-server(.exe) the server program
├─ config.json server settings (which scripts to load, etc.)
├─ components/ native components <-- omp-mysql.dll/.so goes here
├─ gamemodes/ compiled gamemodes (.amx)
├─ filterscripts/ compiled filterscripts (.amx) <-- mysql-admin.amx here
└─ qawno/include/ Pawn includes (.inc) <-- omp-mysql.inc here
In config.json:
"pawn": {
"main_scripts": ["mygamemode 1"],
"side_scripts": ["filterscripts/mysql-admin"]
}[ GTA SA client ] --network--> [ open.mp server ]
├─ runs your gamemode/filterscripts (Pawn)
└─ loads omp-MySQL component ──TLS──> [ MySQL ]
Now you know the vocabulary. Next: Quick Start or What is MySQL?.
Understand
Use
- Installing MySQL
- Docker Compose
- Getting started
- Configuration
- SQL crash course
- Designing your tables
- Storing game data
- Dates & times
- First queries
- Async patterns
- Reading results
- Prepared statements
- Passwords & hashing
- Transactions
- Models (active-record)
- Tutorial: login system
- mysql-admin demo
Deeper
Reference