Forum

> > CS2D > Scripts > Server reservations
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Server reservations

3 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Server reservations

knight-
User Off Offline

Zitieren
Hi all guys!
I have an idea is server reservations,it's like CS1.6 .
I want the lua if player = 30/32 players,that kick player who not admin but wants to join.
Is it possible?Please help

alt Re: Server reservations

ohaz
User Off Offline

Zitieren
Ah, you want that the 31st player always gets kicked except for when he is admin?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
dontKickAdmins = { 1,2,3 }

function tableContains(table, element)
 for _, value in pairs(table) do
  if (value == element) then
   return true
  end
 end
  return false
end

addhook("join", "kickOnJoin")
function kickOnJoin(id)
 if (not tableContains(dontKickAdmins, id)) then
  if (#player(0, "table") > 30) then
   parse("kick "..id.." Slot Reservation")
  end
 end
end
Try out this. It's untested though
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht