[Release] EssentialMode base

Unblock MySql.Data.dll

You can do this by going to your ‘server\resources\essentialmode\lib’ and right-click the MySql.Data.dll file and go to properties. At the bottom should be a button that says ‘unblock’ click that and you are good to go.

1 Like

To the people that have never used SQL here is a mini-guide on it. It’s a lot easier then it sounds I’ve never worked with SQL and I had my server and essential mode running within 20 mins.

Download the MySQL Community edition from here from the windows mysql installer or just google ‘Download SQL Community Edition’

In that link there are two options, use the top one its 1.7mb and is an auto-installer just keep everything default. It might ask what MySQL tools you want to install. I clicked full install, it might ask you to install python you can ignore it. In the end it will want you to install the example sql files I just canceled the setup for that and moved on you don’t need it.

This link was pretty helpful with pictures but kinda dated, the MySQL Server + MySQL Workbench is recommended if you choose custom install. This is a step-by-step guide for the install

There are lots of different MySQL ‘workbench’ apps that create an easy to use interface for viewing and managing your SQL database. I HIGHLY recommend you install the MySQL workbench included with the installer or get your own, you won’t have to use that windows CMD console to manage your stuff as pictured in the guide.

Once you install and open your MySQL server through the MySQL Workbench (has a dolphin icon) you can import .sql script that comes with essential mod. Follow this youtube video to import the script into your sql database. Be sure to click refresh to see that your SCHEMAS has been updated after running the script.

Once you upload the script edit the fiverebornserver\resources\essentialmode\server\player\login.lua with your own sqldatabase info. I run everything locally so all I needed to update was my SQL password where it said 1212 in that script. The MySQL default IP is 127.0.0.1 you shouldn’t need to change that if you are hosting it on your own pc.

Now do the same thing for the MySQL login information for the sv_admin.lua file in fiverebornserver\resources[essential]\es_admin location. If you don’t do this it will give you an es_admin error when you start the server.

If you get a failure to greenlight error its because your server blocks the MySql.Data.dll file so go to fiverebornserver\resources\essentialmode\lib and right-click MySql.Data.dll and select properties, click Unblock at the bottom.

That’s it you’re done.

Be sure to include -essentialmode and -es_admin in your citmp-server file.

When using essentialmode console commands such as ‘setadmin’ the [player id] is the one assigned inside the server don’t use your STEAM ID or it will say player not in server. - please don’t message me for stuff like this.


Hope this helps, don’t ask me for further help I’m not a dev or programmer I just run a server locally for my friends. I don’t have any experience with 3rd party hosting services either. If any of this info is wrong or dated let me know and I’ll edit. I just think essentialmode has a ton of potential and is probably going to be a staple in server hosting/future scripting.

3 Likes

hi guys iv install the mod when i connect my steam id comes up in the db it loads fine until it hits inti session how do i fix pls

Hope this helps

1 Like

thanks oi fixed it bro

Update 1.0.0, 08-02-2017

This update will not be plug & play compatible with older versions, please use the new SQL.

Included

  • EssentialMode
  • Admin plugin
  • Example gamemode

From now on EssentialMode is no longer a gamemode, this means that the player won’t spawn if you don’t have another one loaded. There is an example gamemode that comes with an example of how to properely spawn a player wherever you want. This means no more teleporting wherever you want the player to actually spawn.

Features

  • Ban length & Proper ban table.
  • Cleaner code

New events

-- Gets called when a user command is successfully ran.
AddEventHandler('es:userCommandRan', function(source, command_args, user) end)

-- Gets called when any command is ran
AddEventHandler('es:commandRan', function(source, command_args, user) end)

-- Gets called when an admin command is ran
AddEventHandler('es:adminCommandRan', function(source, command_args, user) end)

-- Gets called when a non existant command is ran. (This can be cancelled to not display the message)
AddEventHandler('es:invalidCommandHandler', function(source, command_args, user) end)

-- This gets called when an admin command is ran, but the user does not have permission to run it.
AddEventHandler('es:adminCommandFailed', function(source, command_args, user) end)

-- This gets called when a chat message is send.
AddEventHandler('es:chatMessage', function(source, command_args, user) end)
4 Likes

Works great, thanks.

How exactly does it work now. Is it /ban id 10h/m/s reason or? Im trying to figure it out by reading the code but just cant seem to get it.

/ban id 1h please follow the rules

Will ban someone for 1 hour. Replace that with 50m and it will be for 50 minutes. And so on

2 Likes

My game crashes when joining with the updated version, old version worked fine and I installed this the exact same way and I did not forget to use the new SQL. Edit: Sorry I should read better: “From now on EssentialMode is no longer a gamemode, this means that the player won’t spawn if you don’t have another one loaded”

Okay, I so I did /ban ID 50m reason, and it says it expires in 1969.
Hours and days dont default to 1969.
days dont register, they can join back and it doesnt show up in the sql (/ban 5 2d test)
https://gyazo.com/5af5520ec4e69cd928d992bda02ca881

That is because days aren’t build in. Only minutes/hours are. And ofcourse normal seconds, anyhow re-download it and replace sv_admin.lua to make it not 1969.

1 Like

Oh okay, Thanks for fixing it.
Is there any chance of you adding days for the lazy people that don’t want to type out 24h for 1 day or etc?
Also, could you make it where it says how long you were banned for automatically in the reason?
So if you were banned maybe it could say “Banned: (20 minute(s))” or "Banned: (24 hour(s))?
Also, when I first get banned, without being admin it says insert site (where and how do I set that up if you would like to help, if not I understand)
Also, the first time I connect it says i was banned, and if I try again it lets me back in even though my time has expired

Lets put a little disclaimer here:

es_admin IS AN EXAMPLE, it is not supposed to actually be used on servers. I provide no warranty at all if anything goes wrong.

Now we got that out of the way,
It specifies it in the reason if you don’t specify a reason. You need to change insertsite in essentialmode/server/main.lua then line 16.

And no, I won’t build that in, you have todo that yourself.

1 Like

Is there a way to get someone’s player ID with the console?

Type “status” in console.

Is the ban part of this not working for anyone else? Also the report command works but spams my console with tons of errors.

Hi @Kanersps thx for this great gamemod! just tested it and it works great :slight_smile:
i do found an issue regarding the money system.

When the player connects to the server his amount is always 0.
I can change the with the setmoney command and then the amount changes.
but when the player reconnect the value on the screen is back to 0, however in the DB the value is still the correct one.

Is this normal behavior?

Any question related to “money display”, will hereby be removed and you will be warned. If you do not know how to set this up by looking at the code you should not be using EssentialMode. You need to make your own gamemode with this, the display was only there as a nice gesture. And needs to be enabled manually. I will provide no help for this.

1 Like

Thanks for the reply , it actually answered my question :wink: