[Release] Smart allowlist and password protection script (No SQL required)

Features:

  • Standalone, meaning no SQL required.
  • Easy to configure (add people to allowlist, restart script, done).
  • Allowlist only mode (only people on the allowlist are able to join).
  • Password only mode (you have to enter the password).
  • Allowlist + Password mode (you have to be allowlisted and enter the password).
  • Smart mode (either be allowlisted or enter the password).

Screenshots:

Entered wrong password 3 times


Download:


Installation:

  • Clone or download via Github
  • Put it into your resources folder
  • Add ensure pun_allowlist to your server.cfg file
  • Start your server or just refresh and ensure the resource

Changelog:

May 8, 2020
  • Initial commit
May 22, 2020
  • Possibly fixed users getting stuck at any point.
Sep 4, 2020
  • Possibly users getting stuck at beginning.
Jun 17, 2020
  • Swapped deferral wait timers with functions that will be forced to wait the specified amount of seconds. Configurable for faster loading times or more stability.
Nov 30, 2021
  • Changed every occurrence of the word “white” to “allow”.
Jul 2, 2022
  • Added support for password masking by using AdaptiveCards 1.5. Note: This only works once FiveM has support for it too.
  • When all config options are off it’ll now immediately skip all checks, allowing users to join about a second or so sooner.
  • Fixed a bug where the correct password wouldn’t be accepted. Previous versions weren’t affected.

Credits:

  • enferList for some bits of code but mostly the logic and idea on how I wanted this script to work in the end.
  • Frazzle for basically 100% of the code that makes the passwords work, without this a lot more swearing would have been involved in the making of this.
25 Likes

Great script, Thank you !

Nice release !

Very Unique. It is much better than all of the other Password/whitelist scripts. One thing you should do when you got some free time is add a queue that works with this script.

1 Like

Woah, very cool. Bloody awesome job mate!

so in the server.lua under the Config.Whitelist section you can add the steamID of the players that want whitelisted, looks like 6 rows there to replace with new steamids, and room to add as many as we would ever need. Am I correct about this? I mean thats the place in the file to add steamIDs (sorry for the babybaby newbie question) I am mostly unsure about everything I do so im padding my bet, One of the other devs on the server was JUST talking about a system like this. what are the odds?!?!? I love you thank you!!!

Thank you!


While the idea is nice, there’s already an existing queue script (ConnectQueue) and as long as you would start that after my script, it would work perfectly fine. I would only do it if @Nick78111 (author of ConnectQueue) would be okay with it.


Correct! You can add as many identifiers as you want. The important thing would be to have a comma after every single identifier except for the last one.

I say that because it saves loading more resources as that will slow and lag the server.

I couln’t agree more with you. I try to generally have as few resources running as possible and always trying to optimize them to be more performance friendly. The reason why I’m not doing it is because I would end up using a very similar method like ConnectQueue does, possibly even copying and editing some parts of it which some people are not okay with and I respect that.

Like I said, if Nick78111 would give me the go-ahead, I’d happily do it!

1 Like

Yeah that makes sense! I would love to see it at somepoint. Until then I just hope <3

Great Script. Thank you.

Critique withdrawn… I guess it is just not supposed to fill in the same role as every other whitelist system out there.

If you do have some criticism then don’t refrain from telling me, I always strive to make my resources better :smile:

stuck here :confused:

started it above all scripts, only have my ip under whitelist

EDIT: Okay so i have established that it only gets stuck here if im not whitelisted

That is weird, I’ve just looked into that issue and thoroughly tested the resource in every possible configuration and it worked flawlessly. I do have a suspicion though, could you go to server.lua, around line 45-ish and change “Wait(0)” to “Wait(200)” for me? After that just restart the resource using “restart pun_whitelist” in the server console (or restart the entire server if you want to) and try connecting again with a deliberately wrong IP address whitelisted.

If that does not work then you can try using the version linked down below. It’s only recommended to use this if you have to troubleshoot something and apart from putting some infos into the server console, it doesn’t really have any additional functions.

pun_whitelist.zip (2.8 KB)

Just rename the folder of the current whitelist script (eg. rename “pun_whitelist” to “pun_whitelist_backup”) and unzip the resource linked above, then move it into your resources folder. Make sure to add this to the server.cfg if you need to in case the name of the folder is different, then start the server up. You can mostly just copy and paste the configuration from your previous version (the backup one) over, so you don’t have to configure everything again. Don’t remove the “Config.Debug” part though.

Once you’re all done with that and everything is up and running, try joining your server exactly the same way you did before when the error occurred, basically trying to get the error again. Once it happens again, go over to your server console and copy everything inside it that starts with “WHITELIST DEBUG” so I can take a look at it and try to fix the problem.

Sorry if this is an inconvenience for you :sweat_smile:

Increasing the wait time seems to have fixed it. Thanks

1 Like

That is awesome, thanks for letting me know! I will update the resource right away.

No problem, thanks for the ability to use this great resource. :yum:

Hey I have tested a few scripts including this one and the problem I see with them is AC, and not been able to use text.password, I love the script and the password and whitelist in one but showing the password to the end user lets say for live streamers is not the best of ideas, and we can’t say black your screen as some FiveM crashes are not there fault and we should have to make them black the screen every second lol

I not sure what the work around is, I not sure if we can use another UI, can’t we use the html UI on the login screen rather then AC?

AC?


Thanks for your feedback! I totally agree, but I’m using AdaptiveCards by Microsoft, which is technically not based on HTML at all. People have been asking for a password input in AdaptiveCards since 2018 but still nothing.

There are a couple other ways to deal with this though:

  • Have an in game HTML (NUI) password check that actually uses the HTML password-text attribute
  • You can tell everybody who’s joining to never show the password if they are streaming
  • Change the password whenever you believe that there has been a security breach
  • Use whitelist only and add trusted people

The last method that just came to mind would be an algorythm that will randomize the password with every server restart. I do have the required knowledge to make all that happen. Technically I could also add a function that will post the password in a specific discord channel.

I might do a secondary branch with some more security features if it is something people do want, since we don’t know if a password tag will ever be available for AdaptiveCards.

1 Like