
A custom config file has also been used to easily change your database variables (username/database name/database password) and will allow you to easily add more configuration options going forward.ĬEF Login/Registration pages with error handling By using this feature, this avoids any errors of users connecting before your resources are done loading. This also utilised the delayedInitilisation feature added in RAGE:MP 1.1 to allow time for your database and any other assets on your server to be loaded first before allowing any user connections. This handles both logging in and registration. If you're hosting this locally and you haven't made/changed the MySQL info, the default should be fine.Ī MySQL boilerplate to quickly create an account system without all the work. At the top is the connection info, change this to whatever your IP and MySQL username/password is. Go to packages/mysql/mysql.js and open it. Once created, import the ragemp-mysql.sql into your newly created database. Then do 'npm install' to install the required node_modules.Ĭreate a new database and call it whatever you want (Inside the script it is called 'ragemp-mysql').

Open your command prompt and change your directory to your server folder.

Unzip the source and place it inside of your server files folder.

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. You'll need to have a MySQL server setup, either using WAMP/XAMPP/or from a server. If you find any issues, leave a comment on my thread or leave a comment on this resource. This is intended for beginners so the code is pretty basic and nothing fancy has been done so it is easily readable. This template only stores usernames, passwords(encrypted with BCrypt), position and money so anything extra will need to be implemented yourself. This is a template of a very basic login/registration system you can implement into your game mode to get started. 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. I highly recommending using my more updated resource "MySQL Accounts" instead as it fixes known issues and runs better:
