📦 Scripts
🎁 Akilla Donator
Getting Started
Database Setup

💾 Database Setup

The donator store requires database tables to store player coins, purchases, and redemption codes.

Running the SQL File

Using HeidiSQL / MySQL Workbench

  1. Open your database management tool
  2. Connect to your FiveM database
  3. Open the file sql/setup.sql from the resource folder
  4. Execute the SQL script

Using phpMyAdmin

  1. Log into phpMyAdmin
  2. Select your FiveM database
  3. Go to the "Import" tab
  4. Choose the sql/setup.sql file
  5. Click "Go" to execute

Using Command Line

mysql -u username -p database_name < sql/setup.sql

Tables Created

The SQL script creates the following tables:

donator

Stores player coin balances.

ColumnTypeDescription
idINTPrimary key
licenseVARCHAR(100)Player license identifier
coinsINTCurrent coin balance
total_spentINTTotal coins spent
total_purchasedINTTotal coins purchased
created_atTIMESTAMPAccount creation date
updated_atTIMESTAMPLast update time

donator_pending

Stores pending Tebex redemption codes.

ColumnTypeDescription
idINTPrimary key
transactionIdVARCHAR(100)Tebex transaction ID
packageVARCHAR(100)Package name purchased
redeemedTINYINTWhether code was redeemed
redeemed_byVARCHAR(100)Who redeemed the code
created_atTIMESTAMPPurchase date
redeemed_atTIMESTAMPRedemption date

donator_purchases

Logs all in-game purchases for analytics.

ColumnTypeDescription
idINTPrimary key
licenseVARCHAR(100)Player license
item_idVARCHAR(100)Item purchased
item_typeVARCHAR(20)Type (vehicle/item/bundle)
item_nameVARCHAR(100)Display name
costINTCoins spent
purchased_atTIMESTAMPPurchase time

donator_transactions

Audit log for all coin changes.

ColumnTypeDescription
idINTPrimary key
licenseVARCHAR(100)Player license
typeENUMTransaction type
amountINTAmount changed
balance_beforeINTBalance before change
balance_afterINTBalance after change
reasonVARCHAR(255)Reason for change
admin_sourceVARCHAR(100)Admin who made change
created_atTIMESTAMPTransaction time

Verify Installation

To verify the tables were created, run this query:

SHOW TABLES LIKE 'donator%';

You should see:

  • donator
  • donator_pending
  • donator_purchases
  • donator_transactions

✅ Done! Your database is now ready. Proceed to Configuration.

Troubleshooting

"Table already exists" error

This is fine! The script uses CREATE TABLE IF NOT EXISTS, so it won't overwrite existing data.

"Access denied" error

Make sure your database user has permission to create tables.

oxmysql connection issues

Verify your server.cfg has the correct connection string:

set mysql_connection_string "mysql://user:password@localhost/database?charset=utf8mb4"