Jump to content

Basic MySQL Gamemode 1.2

   (9 reviews)

1 Screenshot

About This File

UPDATE

I highly recommending using my more updated resource "MySQL Accounts" instead as it fixes known issues and runs better:

This resource will stay up, however I will not be giving any help for this resource as I don't believe it should be used for serious projects.

----

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.

Edited by MrPancakers


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
  • Like 10

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

Heathen

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

A very useful demonstration.

Link to review
ragempdev

   7 of 9 members found this review helpful 7 / 9 members

good paragon leak ...

  • Like 1
Link to review
Tryanide

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

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

Link to review
hubba

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

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

Link to review
Antonio Santana

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

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.

Link to review
Majort

· Edited by Majort

  

hello bro pls i need help 

 

where exactly am i uploading this files to as i am using vibegame hosting pls help me out bro

 

below is the pics of where i uploaded it to on my server kindly give a detailed on how and where i should upload this plss

 

https://ibb.co/8YWKNCD

Link to review
×
×
  • Create New...