I need help about server five m

I have this one but still, I get the MySQL nil value stuff

Post the error…

Error loading script server.lua in resource ply_basemod: server.lua:33: attempt to index a nil value (global ‘MySQL’)
stack traceback:
server.lua:33: in function ‘resetOnStart’
server.lua:36: in main chunk
Failed to load script server.lua.

(Resource has the server_script)

That script is fairly old, I can’t even find it to reference lua 33 and 36. But if they look like this MySQL:open(“127.0.0.1”, “gta5basemods”, “root”, “”) – Change the identifiers for your dataBase

They aren’t used anymore. Which is why the convars are set in the config, not the file itself.

function resetOnStart()
local state = “0”
33. MySQL.Async.execute(“UPDATE users SET player_state=@state”, {[’@state’] = state}, function(data)
end)
end
36. resetOnStart()

I am using the newest ES
Edit: Well the issue is that MySQL is not defined… The code doesn’t have any MySQL included and I don’t know how to do that

That’s either an old SQL code method or its not connecting to the mysqlasync resource, or it’s not connecting to your DB. It’s for an old version of ES anyway so you would have more converting to do anyway. If you don’t have knowledge of lua basics, you gonna have a hard time with this. Just move on to fx scripts and use a current version of ES. And play around with porting as more knowledge comes to you.

Edit: you say I am using the newest ES. Ok, have you converted that old script to work with es 5.0? As I said above, you’ll have more converting to do than just SQL code.

Like, what newer version they have out there for stuff like that ?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.