[Release] Freeroam 2 by Kanersps

it’s seems you are passing an incorrect value,post your confing and what you have change.whithout seen what you have done,is so hard try to helping you.
just remember when you post to change username and password from file.

I am really grateful for this contribution. I installed a WAMP server, and I imported gta5_gamemode_freeroam in as a database. In the register.lua, on line 5, I left the user as root, and I created a password for root on the server, which I also put on line 5, but I cannot get the client to link up to the server. All I get is the message in the picture.

Any help would be greatly valued and appreciated.

This is what I changed in register.lua, I tried different configs, with and without port number.
Commenting out lines, so one line at a time is seen by the server.
I usally do this if something doesn’t work, to figure out what te problem is when I’m coding in javascript or php.
But Lua is another beast to tame.

-- MySQL:open("IP", "databasname", "user", "password")

-- MySQL:open("127.0.0.1", "3306", "gta5_gamemode_freeroam", "root", "mysql")
MySQL:open("127.0.0.1", "gta5_gamemode_freeroam", "root", "mysql")

local json = require( "json" ) 

And in MSQL.lua I tried all of this, and nothing works.

function MySQL.open(self, server, database, userid, password)

	local reflection = clr.System.Reflection
	local assembly = reflection.Assembly.LoadFrom('resources/freeroam/lib/MySql.Data.dll')
	self.mysql = clr.MySql.Data.MySqlClient
	self.connection = self.mysql.MySqlConnection("server="..server..";port="..port..";database="..database..";userid="..userid..";password="..password..";charset=utf8mb4")
	-- self.connection = self.mysql.MySqlConnection("server="127.0.0.1";port="3306";database="gta5_gamemode_freeroam";userid="root";password="mysql";charset=utf8mb4")
	-- self.connection = self.mysql.MySqlConnection("server="127.0.0.1";database="gta5_gamemode_freeroam";userid="root";password="mysql";charset=utf8mb4")
	self.connection.Open()
end

As you can see, i even tried to pass the ip adress and port number in MySQL.lua, but it keeps throwing errors.
Is seems I can’t get a connetion with the sql server.
I even tried to replace the MySQL connector But that didn’t work either.

Password is mysql, userid is root.

I also tried different operating systems, Windows 7, Windows 8 and Ubuntu server.
There must be someting I’m missing, but can’t seem to figure out what it could be.

have you created dbase?

Yes, I did create the database.

have you

require "resources/freeroam/lib/MySQL

in register.lua?
so, what mean red x in your screenshot. sorry but i use workbench for manage db.

Red x doesn’t mean anything, It’s just the version of phpMyAdmin i use that places the red x in there.
In another version of phpMyAdmin the red x doesn’t show up.

This is the code i have.

-- Loading MySQL Class
require "resources/freeroam/lib/MySQL"

-- MySQL:open("IP", "databasname", "user", "password")

-- MySQL:open("127.0.0.1", "3306", "gta5_gamemode_freeroam", "root", "mysql")
MySQL:open("127.0.0.1", "gta5_gamemode_freeroam", "root", "mysql")

local json = require( "json" ) 

I solved it, it seems the MySQL connector file was blocked by the OS, even on Ubuntu.
Now it works on all of the operating systems I tried,
I’ts a stupid mistake I made by not checking the security settings. Stupid me :smile:.
So yes, I’m dumb as ****.

CitizenFX.log (540.3 KB)

Any one can please help me with this? Already fix resources/freeroam/lib/MySql.Data.dll’)` bla bla, but stil stuck in this black screen, i have create my DB in mysql workbench and works fine, the register system is working. My game is update steam version, fivem-map-skater works fine but this game mod no. Please, help me.

2 Likes

Add - fivem-map-skater in citmp-server.yml under AutoStartResources. Because you just dont have any map and gametype running.

2 Likes

Yes you’re right @Arturs!

I just tried it and it works!

Thanks for all your support guys!

Svensson

I seem to be getting this error when I do /register Console I dont know what file I would edit or where to even begin.

What did you do to unblock the MySQL connector file?

Just right click the MySql.Data.dll file that can be found under resources\freeroam\lib , and unblock it, That’s all.

Also make sure your firewall isn’t blocking the server or your MySQL server.

Hello ,

I want say allready you work is realy good… Now I whant add some command in your Freeroam but any test is over! Can you tell me vhere I can put new command?

Thanks
Cedric

Thank you for this nice script ! But i have one problem ! Im typing /register and my password and nothing is happening ! Can someone help me !

Thanks! I would have totally missed that. Did you compile a MySQL server into you game server directory, run it as a installed service, or did you install something like WAMP, LAMP, or XAMPP?

I used a wamp stack, the latest version of Ampps.
I had it already intalled, because I do some experimenting in javascript and php from time to time.
But you can use any wamp stack for this purpose, as long as the MySql version supports utf8mb4.
If you intall it in the server directory, you can make it automatically start from run.bat when you start the fivereborn server.

@echo off
start wamp/usbwebserver.exe %*
start CitizenMP.Server.exe %*

There is nothing to it, just add a line like the code above in your run.bat depending on which version you use, and the wamp stack will start first, before the five reborn server starts.
In this example i used Usbwebserver, but that doesn’t matter. You can use any wamp stack as I mentioned before, as long as the MySql version shipped with it supports utf8mb4.

I really appreciate your insight Rich, I really appreciate it. I think my hang up is something with Windows 10. I put a DWord into the registry to stop the need to having to unblock certain files from other computers. I re-downloaded everything, to be sure, set my WAMP back up, created the database, edited the register.lua, added freeform to the load order, disabled my firewall (Just to be sure), and nothing. It’s making me want to pull my hair out, because I have mucked with server admin stuff for a long time and I know it has to be something simple.




Hey,
I have a question about this script,
I installed the freeroam in my resources blabla and im running a database with heidisql like it stays in the description, but when i join the server i see the black thing with quick rules and when i type a command it does nothing and my console getting spammed. Hope u can help me.
Thanks.