Greetings;

I’ve had this running debate as to which is more reliable in preventing “sus” players from joining my server. I could be wrong but, I put a little segment of code in [system]/hardcap/server.lua that looks like this;


local playerCount = 0
local list = {}
RegisterServerEvent(‘hardcap:playerActivated’)
AddEventHandler(‘hardcap:playerActivated’, function()
if not list[source] then
playerCount = playerCount + 1
list[source] = true
end
end)

AddEventHandler(‘playerDropped’, function()
if list[source] then
playerCount = playerCount - 1
list[source] = nil
end
end)

AddEventHandler(‘playerConnecting’, function(name, setReason)
local player = source
local steamIdentifier
local identifiers = GetPlayerIdentifiers(player)
local setKickReason = setReason
local cv = GetConvarInt(‘sv_maxclients’, 64)

for _, v in pairs(identifiers) do
if string.find(v, “steam”) then
steamIdentifier = v
print('Connecting: ’ … name … ’ ’ … steamIdentifier … ‘^7’)
break
end
end

if not steamIdentifier then
CancelEvent()
setKickReason(“Get Steam, please”)
print('No Steam: ’ … name … ‘^7’)
end

if playerCount >= cv then
print(‘Full. :(’)
setReason(‘This server is full (past ’ … tostring(cv) … ’ players).’)
CancelEvent()
end
end)

Naturally, I receive all manner of nasty feedback about, “you don’t have to have to Steam to play Fivem, yada, yada, yada…” but, it seems pretty effective. I am hoping to convert the Steam identifier into HEX and running it against http://www.vacbanned.com/ to see if the person has ever been banned.

What I would like is some feedback from other server owners to see what they think. I’ve already had my share of clowns logging on and running every manner of SQLi you can think of. I’ve been lucky thus far.

Is there a better approach I should consider?

Cheers

Hello,

I know in the case of my server, we require players to have both Steam & Discord linked to their FiveM, obviously with some community members having bought GTAV through Epic Games, they’re unable to join the server for whatever reason. But, In a sense, It removes just a few of those “shitters” from joining your server who have either removed their identifiers to circumvent bans or whatever they’re attempting to do.

I haven’t seen any real negative impacts of having a server require both a Steam & Discord Identifier, we hardly ever see anyone unable to connect to the server because of having those requirements in place. Overall, It’s not a bad thing to have, doesn’t affect much & gives you an extra piece of protection in a sense.

I hope this helps :slight_smile:

1 Like

Thanks for your response! I think we see things along the same lines. In a game where there is no “end game win”, it’s hard to understand why someone bothers to even cheat. Ah well, such is the human race. Right now, I’d love to have a handful of people stress-test the server and comment on the bugs, play-ability, etc., etc. Building a population seems ridiculously hard for some reason and I’ll be dipped if I’m going to pay for “boosts” and whatnot. I run a fairly beefy system and it’s about $100NZD/month. Add another $30NZD to that for Patreon and pretty soon, I’m running a deficit entertainment center. :slight_smile: I love the game and I love to code but, Jeez… fighting the “shitters” while seeking legitimate players… when does this turn into fun? :smiley:

Thanks again!