1 Screenshot

About This File

Basic MySQL Gamemode

Github Linkhttps://github.com/MrPancakers/ragemp-mysql

Resource Thread

 

Discord: MrPancakers#9283

This is a template of a very basic login/registration system you can implement into your game mode to get started. This template only stores usernames, passwords(encrypted with BCrypt), position and money so anything extra will need to be implemented yourself. This is intended for beginners so the code is pretty basic and nothing fancy has been done so it is easily readable.

If you find any issues, leave a comment on my thread or leave a comment on this resource.

Installation

You'll need to have a MySQL server setup, either using WAMP/XAMPP/or from a server. To keep this short I will not go through setting these up, simply Google 'How to set up WAMP' for example to get it set up.

  1. Unzip the source and place it inside of your server files folder.
  2. Open your command prompt and change your directory to your server folder. Then do 'npm install' to install the required node_modules.
  3. Create a new database and call it whatever you want (Inside the script it is called 'ragemp-mysql'). Once created, import the ragemp-mysql.sql into your newly created database.
  4. Go to packages/mysql/mysql.js and open it. At the top is the connection info, change this to whatever your IP and MySQL username/password is. If you're hosting this locally and you haven't made/changed the MySQL info, the default should be fine.
  5. You're all set to go.

What's New in Version 1.2   See changelog

Released

  • You can now retrieve player money clientside (player.money changed to player.data.money)
  • Renamed the browser variable from browser1 to loginBrowser
  • Changed /updatemoney to /setmoney
  • Basic error handling for /setmoney (Should now return a message if you didn't put anything in or you didn't put a number in)
  • Fixed error for those who quit before logging in
  • Shortened player position values, now only goes to 2 decimal places
  • Added health and armour to the database to further show examples
  • Added /sethealth and /setarmour for more examples of usage
  • Added double checking for user passwords on registration to avoid typos in passwords when registering
  • Added error handling on MySQL queries



User Feedback

Create an account or sign in to leave a review

You need to be a member in order to leave a review

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Tryanide

Report ·

   2 of 2 members found this review helpful 2 / 2 members

Great start for anyone trying to work a database into their gamemode

Share this review


Link to review
ragempdev

Report ·

   4 of 5 members found this review helpful 4 / 5 members

good paragon leak ...

Share this review


Link to review
hubba

Report ·

   1 of 2 members found this review helpful 1 / 2 members

great ,, my favorite gamemode to play on rage ,,

Share this review


Link to review
rootcause

Report ·

   1 of 2 members found this review helpful 1 / 2 members

beast

Share this review


Link to review
Antonio Santana

Report ·

   0 of 1 member found this review helpful 0 / 1 member

Thanks for that, but I have a problem I have my local gta server is when I try to connect a bdd that does not also host locally I have an error that appears: [MySQL] Error : ENOTFOUND. Can anyone help me ? My web host or my bdd is located is 1 & 1. Thank you is sorry for my langague I use a translator.

Response from the author:

I would suggest contacting me on Discord if you haven't already (MrPancakers#9283). It just seems you haven't set it up properly and there's nothing wrong with the script.

Share this review


Link to review