[Release] EssentialMode base

btw i have essentialmode in my resourcefolder but when join map and player spawned but when die it will not respawn anymore and stuck in wasted screen… can u help me to solve this problem kane ?

I have the same issue, i guess you have to make a respawn script…cant rely on kane all the time. Got to figure your way around it.

i think he still confuse on how to fix respawn script :stuck_out_tongue:

No I’m not, you should read a few of the latest update logs.

1 Like

cant do any command that comes with this on my server

No commands come with this but /info ?

1 Like

that command does not work in game

how to fix respawn script

Hi, I already have a database that i use for website and game servers, which uses port 3307.

Rather than change my existing database port and all my other configs, can someone explain how I can manually set the Fivem server to use the same port (3307) in the login.lua settings (in essentialmode).

I’ve tried adding “port” and “3307”, as well as 3307 without quotes, and “ip:port” but nothing seems to work.

Could someone that HAS managed it help me out please, it would help me no end.

I’m beginning to think that for someone reason it’s hard coded in the files and can’t be changed perhaps, which would be a shame as I’d like to host a server for friends to play on.

Many thanks!
Mart

@martuk66 you can try to add the port in lib/MySQL.lua ?

https://github.com/kanersps/fivem-essentialmode/blob/master/lib/MySQL.lua#L18

1 Like

Many thanks for pointing me in the right direction … all sorted, thank you!

Hey there, I know you said “Limited support”, however I would love some help regarding spawning of weapons.

Where would I start to allow a player to do /weapon (weapon name)

I got this error

[    184109] GlobalError: Reliable client command overflow.
[    184109] GlobalError: Reliable client command overflow.
[    184109] fx::TestScriptHost::InvokeNative: execution failed: Error executing native 0x000000007fdd1128 at address 0x7ffbf76d746c.
[    184422] getaddrinfow: prod.ros.rockstargames.com and a paper urn
[    184578] connect 1a86337f
[    184750] EndpointMapper::HandleRequest: POST /gta5/11/gameservices/presence.asmx/GetPresenceServers
[    184906] closesocket 0x3044
[    187640] GlobalError: Reliable client command overflow.
[    187640] fx::TestScriptHost::InvokeNative: execution failed: Error executing native 0x000000007fdd1128 at address 0x7ffbf76d746c.
[    187656] Error resuming coroutine: Execution of native 000000007fdd1128 in script host failed.
[    187656] stack traceback:
[    187656] 	[C]: in upvalue '_in'
[    187656] 	citizen:/scripting/lua/natives.lua:1319: in function 'TriggerServerEventInternal'
[    187656] 	(...tail calls...)
[    187656] 	client/main.lua:27: in function <client/main.lua:21>
[    188640] GlobalError: Reliable client command overflow.
[    199578] process exited with 5432800!
[    201328] closesocket 0x5e8

Update 2.0.0, 18-03-2017

This update requies you to:
A. Update your currently database, ( go to the table “users” and add a new column called: “group” with type of VARCHAR. Then edit: “money” change its type to: “double”. )
B. Remove your DB and use the new provided SQL.

You also need to change everywhere where you are adding money to:
user:addMoney(amount) or user:removeMoney(amount) or user:setMoney(amount)
(See es_admin for an example)

Features

  • Player class
  • User groups
  • General cleanup
  • Additional settings
  • Player session variables

New settings ( set with event “es:setDefaultSettings” )

{
   startingCash = 0 -- Set the amount of money you want people to start with
   enableRankDecorators = false -- Sets a decorator with the players permission_level on their entity.
}

New events

-- Adds a new group with the groupname of your choise, you can make it inherit from custom groups or from the main ones. Inhereting from superadmin means that group has access to everything.
TriggerEvent("es:addGroup", "groupname", "inherits")

-- Returns all of the groups inside of the: groups argument
TriggerEvent("es:getAllGroups", function(groups) end)

All user class functions

-- Returns permission_level of that player
Player:getPermissions()

-- Sets the permission level to the specified argument
Player:setPermissions(level)

-- Kicks the player with the specified reason
Player:kick(reason)

-- Sets the player money to the specified amount
Player:setMoney(amount)

-- Adds to the current total amount of money
Player:addMoney(amount)

-- Removes from the current amount of money
Player:removeMoney(amount)

-- Sets a session var for the player
Player:setSessionVar(key, value)

-- Gets the specified session var, or nil.
Player:getSessionVar(key)

Default user groups (If using “es_admin” you can set a player group in rcon with: “setgroup userid groupname”

-- First parameter is group name, second is inheritance

-- User group, lowest possible.
user = Group("user", "")

-- Admin, is allowed to run administrative functions
admin = Group("admin", "user")

-- Superadmin, can run any command, bypasses command levels
superadmin = Group("superadmin", "admin")

That’s it, I probaly did some misc stuff that I forgot.

Anyhow, that is version 2.0.0 of EssentialMode. Please report any bugs found.

5 Likes

Not sure if intentional or just an oversight, but in the chatMessage handler: If the client types a command that does not exist, it will display what they typed in the chat. There is code in your handler to trigger an event (es:invalidCommandHandler) for invalid commands, but it does not exist. In the same part, it says

if WasEventCanceled() then CancelEvent() end
Shoudln’t it say:

if not WasEventCanceled() then CancelEvent() end

Secondly, the enableRankDecorators setting doesn’t seem to do anything. It’s not referenced anywhere else in any file. In your LoadUser function it says

if(true)then TriggerClientEvent('es:setPlayerDecorator', source, 'rank', Users[source]:getPermissions()) end
Did you mean to tie that setting into there?

Lastly, unrelated to any issues, are you able to just briefly explain how the metatables for the player and groups work? I’ve done some research on it but I can’t seem to wrap my head around exactly how you have it set up. I don’t intend to modify it, but I want to understand how it actually works.

Thanks!

You can use the invalidCommandHandler like this, because it is actually correct:

AddEventHandler('es:invalidCommandHandler', function(source, args, user)
	TriggerClientEvent('chatMessage', source, "", {0, 0, 200}, "^1^*Unknown command^r^0, type ^2/help^0 for a list.")
	CancelEvent()
end)

And yes that was probaly an oversight with making it a setting, but decorators are GTA thing, you can look them up on NativeDB for more info.

And last, the metatable stuff, I don’t know “that” much about it, and I don’t think I can explain it properely either, I’m sorry.

1 Like

Hi, I am using Essential Mode with MySql, but sometimes I get “Connection has been disabled by…” <<< this kind of error msg, just wondering what could cause this problem, massive requests stuffs like that? is it just me or has anyone seen this problem also? please help, thank you very much!

That can occur because the connection timed out. You can googl this, it’s should give you results on how to increase the timeout.

First off I apologize if this is a RTFM type question, I’m honestly not sure and I did try (and am still trying) to search on my own for an answer. Basically, I have my SQL server and database all configured, I’ve put everything in the proper location and the server does indeed start. However, I received an error message in the server console and I was hoping someone might be able to provide some insight. The error message I received is:

https://i.imgur.com/WxAwfgp.png

Right click the mysql dll -> properties -> unblock

The dll is blocked i believe.

1 Like