[Release] Additional Server Synchronization and ACL [1.0.6]

THIS MOD IS NO LONGER BEING MAINTAINED BY MYSELF. IT MAY STILL WORK, BUT USE AT YOUR OWN RISK. IF ANYONE IS WILLING TO MAINTAIN THIS PROJECT, PLEASE FORK THE GITLAB PROJECT AND START YOUR OWN NEW RELEASE TOPIC HERE ON FIVEM AND LET ME KNOW ABOUT IT.

This mod provides additional synchronization between clients connected to your server as well as means to control who gets to connect to your server through ACLs. I have had this mod running for over a month now so it’s pretty well tested, hence I decided to share it with you all.

Who is this mod for?

It can be installed on any kind of server. The ACL whitelist can be used for private servers and will work pretty well, and for any other kind of server the ACL can be used to control who can issue rcon commands. It is recommended to disable any white- or blacklisting mod you have installed before.

There is no connection with a database, so there’s no dynamic adding/saving ACLs. You can add this yourself pretty easily, but I left it out on purpose to make it easy for small, private servers (and I don’t need it myself).

What does it synchronize?

You can set the weather and time among other things, that will instantly set it for connected players and new players connecting. For a full list of possibilities, check out the command list below. I also felt compelled to implement Turn Signals/Indicators (server-sided) and add synchronization of the vehicle windows being up or down to completely replace Enhanced Reborn Trainer’s vehicle controls. Players should probably disable vehicle controls on the trainer’s menu, as it will interfere.

Download links below no longer work (host shut down). You can still get the files HERE (Gitlab).

DOWNLOAD .ZIP v1.0.6
DOWNLOAD .ZIP v1.0.5
DOWNLOAD .ZIP v1.0.4
DOWNLOAD .ZIP v1.0.3
DOWNLOAD .ZIP v1.0.2
DOWNLOAD .ZIP v1.0.1
DOWNLOAD .ZIP v1.0.0

GET FILES FROM PROJECT PAGE (Gitlab)

Changelog

v1.0.6

  • Time set in common/vars.lua will now be the default start time.
  • Config files are unaltered since last patch.

v1.0.5

  • Fixed time not synchronizing for new players.
  • Config files are unaltered since last patch.

v1.0.4

  • Fixed time and weather not synchronizing for new players. Edit: People have reported that in some cases time still doesn’t sync yet. It is being looked in to.
  • Fixed peds not spawning and /crowd command having no effect
  • Some feedback now sent as notification instead of chat message (reduce chat clutter)
  • New command /wind, see list of commands for more details.
  • Config files are unaltered since last patch

v1.0.3

  • Fixed the /freezetime command
  • Added time manipulation (see new commands below in the command list)
  • Config files are unaltered since last patch

v1.0.2

  • Can now disable /kick command in server/ACLConfig.lua so other resources can handle this.
  • Can now disable the identity bug workaround to prevent “please try again” message if you trust the 01/30 patch enough.
  • Vehicle indicators/windows now optional and configurable in client/config.lua.
  • Added “Disabling ACL entirely” section in this post.

v1.0.1

  • Workaround for bug when players connect while server is starting
  • Added notification for administrators and moderators when they log in

Setting up the whitelist or blacklist

Edit the server/ACLConfig.lua to set whitelists, bans, mods and admins. Mods and admins are currently indistinguishable, though it may change in future updates. See the server/ACLConfigSample.txt file for an example configuration. You can:

  • IP address black- and white-list and moderation
  • Steam ID black- and white-list and moderation
  • Partial name (word) black- and white-list
  • Prevent high latency players from connecting

Disabling ACL entirely

ACL can be entirely disabled by just commenting out the corresponding files in the __resource.lua file. When this is done, commands can only be entered through RCON.

This is an example where ACL is disabled:

server_scripts {
	"common/ext.lua",
	"common/vars.lua",
	"server/OnCmd.lua",
	-- "server/ACL.lua",
	-- "server/ACLConfig.lua",
	"server/additional-sync.lua"
}

List of commands

/weather [HELP | EXTRASUNNY | CLEAR | CLOUDS | OVERCAST | SMOG | FOGGY | RAIN | THUNDER | CLEARING | NEUTRAL | SNOW | BLIZZARD | XMAS]

/wind [speed 0.0 - 12.0] [direction 0.0 - 360.0]
Applies wind, making trees move and adding an ambient wind sound. speed is in Beauforts, a number between 0.0 and 12.0. direction is in degrees, where 90.0 is west and 270.0 is east.

/time [HELP | NIGHT | MORNING | NOON | EVENING]

/time hours minutes seconds

/freezetime [1 | 0]

/timerate [DAY | NIGHT | BOTH] [0.1 - 10.0]
This changes the rate at which time is passing. 0.1 is ten times as slow, 10.0 is ten times as fast. 1.0 is default. Day is defined to start at 05:30 and night is defined to start at 23:00.

/blackout [1 | 0]

/traffic [0.0 - 1.0]

/crowd [0.0 - 1.0]

/playerlist

/kick [Player ID] [Reason]

You can also execute these commands in your rcon window. Just omit the / prefix.

List of hotkeys

Arrow Down - Bring down the front-side windows in your vehicle
Arrow Up - Bring up the front-side windows in your vehicle
Arrow Left - Turn indicator left of your vehicle
Arrow Right - Turn indicator right of your vehicle

Important side-note

Due to a bug in one of the native server functions, players can connect with the identity of a previously connected player. This is of course a huge security hazard. This ACL implements a workaround that forces players to connect with their own identities at the cost of dropping their connection if it’s discovered that the identity they connect with are not their own. A message “Please try again” is displayed on connect whenever this happens.

This issue persists with all white- and blacklist scripts available that have not yet implemented this workaround!

Enjoy!

You can edit code and/or take bits of code to use in your own project. No credits required! Although a shout-out is always appreciated. I would also appreciate any feedback so I can improve where needed.

25 Likes

I’m having some trouble with the time and weather system. I set my IP in the ACL config and I type in the command but it doesn’t seem to do anything. Not even the help pops up. Other than that, this is amazing! Thank you so much for this! I’ve been waiting for a \system like this. It’s great for RP servers, thanks again. ~ Napalm

Just wanna check im installing this correct, do we need to set up a mysql server for this?
Or is there a different way to run this?

Did you even read it?

2 Likes

Yeah sorry i did read it but im not great with this stuff so just wanted to make sure i was doing things right

Not at all.

If you look at your connect window, you should see 'playername' connecting. (something:something) and check when you connect if this corresponds to what you set your IP address to. If it says (ip:1.1.1.1) then you add that IP address. If it says (steam:11000010bcdef) then you need to add that.

Currently not working with the latest update of FiveReborn

Working fine for me.

Works fine for me. What is the issue you are experiencing?

Please do note that the following patch may make the additional protection built into this script obsolete:

Fix a bug in assignment of TempIDs causing playerConnecting to return incoherent identifiers. Hopefully.

I’m still keeping it for the time being though, since they said “hopefully”.

The commands aren’t doing anything, they just pop up in chat even when I’m logged in as admin.

1 Like

Try one of the commands in rcon (the little textbar on the bottom of your server window) without the / prefix, eg:

weather rain

Does that work? If it does, then you are most likely not logged in as admin. If it doesn’t work then I would like a screenshot of any errors popping up on the server and/or the CitizenFX.log file so I can deal with the issue.

I can’t check for you at this moment, sicne my FiveReborn is currently broken. I am in the process of fixing it and when I do I’ll let you know if the Rcon works.

Everytime I try entering a command in the Rcon, it doesn’t recognise the command. I’m new to all this so what am I doing wrong or how could I fix it?

Screenshots please. Without any information I can’t do anything…

I’m not familiar with “IceCon” and it doesn’t seem to output any useful information. I’d like to see the server log or a screenshot of the server window itself.

Do you reckon I could get a link to an Rcon that everyone seems to use because I know that mine ain’t great.

I installed everything correcltly. The /playerlist works, I set my self as admin, and when I do /weather help, nothing happens in chat. I have tried weather rain in rcon, nothing happens

I did some minor changes and put the download for a new version up. Since the most recent patch there is a bug where if you connect too soon, the function GetPlayerIdentifiers will return nil. If this happens, the script drops the player connection with the message that the server is still starting.

Another change is that moderators and administrators now get feedback that they are logged in as such when connecting. You should see orange text with “You are logged in as administrator/moderator” when you join the server in the chat box.

@madasafish2010 @Atexx
I’m suspecting that another mod you have installed is hijacking the commands. Try moving the line for this mod in AutoStartResources all the way up (under scoreboard/■■■■■■■) or all the way down and see if you can prioritize it. If you have another mod installed which comes with commands, I’d like to know which. If you know some LUA, you can dive into that mod and find the CancelEvent() function for handlers chatMessage and rconCommand, and make sure it doesn’t get called when a command is not found, so that other mods have the chance to handle it.

Check if you get a message “You are now logged in as administrator/moderator” when you get into the game with the new version I posted in the OP. That should help with figuring out what the problem is as well.

I always just use the textbox of the server window, so I can’t really help you with that.

The Rcon command works. I am installing your new version now.