Forum

> > CS2D > Scripts > Server reservations
Forums overviewCS2D overview Scripts overviewLog in to reply

English Server reservations

3 replies
To the start Previous 1 Next To the start

old Server reservations

knight-
User Off Offline

Quote
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

old Re: Server reservations

ohaz
User Off Offline

Quote
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
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview