mirror of
https://github.com/citizenfx/cfx-server-data.git
synced 2025-12-12 06:14:09 +01:00
hardcap: make sv_maxclients dynamic
This commit is contained in:
@@ -18,12 +18,14 @@ AddEventHandler('playerDropped', function()
|
||||
end)
|
||||
|
||||
AddEventHandler('playerConnecting', function(name, setReason)
|
||||
local cv = GetConvarInt('sv_maxclients', 32)
|
||||
|
||||
print('Connecting: ' .. name)
|
||||
|
||||
if playerCount >= 24 then
|
||||
if playerCount >= cv then
|
||||
print('Full. :(')
|
||||
|
||||
setReason('This server is full (past 24 players).')
|
||||
setReason('This server is full (past ' .. tostring(cv) .. ' players).')
|
||||
CancelEvent()
|
||||
end
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user