mirror of
https://github.com/citizenfx/cfx-server-data.git
synced 2025-02-10 07:32:56 +08:00
hardcap: make sv_maxclients dynamic
This commit is contained in:
parent
b944d313dc
commit
4317191f93
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user