English Server reservations

3 replies
Goto Page
To the start Previous 1 Next To the start
03.08.12 07:43:14 am
Up
knight-
User
Offline Off
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
03.08.12 07:46:55 am
Up
ohaz
User
Offline Off
No need for a Lua script
cs2d cmd mp_reservations
https://ohaz.engineer - Software Engineering
03.08.12 07:53:08 am
Up
knight-
User
Offline Off
nonono!
I want a lua that kick player before play,not while playing.
03.08.12 08:00:05 am
Up
ohaz
User
Offline Off
Ah, you want that the 31st player always gets kicked except for when he is admin?
Code:
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
https://ohaz.engineer - Software Engineering
To the start Previous 1 Next To the start