This script will protect your server from everyone who does not know the password.
I hope this script helps FiveM server stay protected from hackers, modders etc. While this isn’t the best way to secure your server. It is one of the easiest.
Screenshots
If the password is incorrect users will be presented with this message:
To install this script
Download or clone the repo from the link above.
Drag the ServerPassword folder into your resources folder.
To add passwords add them to the table at the top of sv_serverpassword.lua
Then just start the script
Have you tried restarting fivem. happened to me a couple times during testing.
Just a quick restart helped. Unless you have changed something in the script
it would work. At the moment it’s just not allowed to have other scripts that are using the deferrals. Scripts like es_extended and various other use them and that makes this script to not work anymore.
Actually I think that’s a bug from FiveM
It because there would be multiple playerConnecting event handlers. and ex_extended has probably got one, if you want to use this with a framework put my code inside that playerConnecting event and move all the other es_extended stuff to where the password is accepted.