ID:268224
 
can anyone show me how to code a thing that only allows a certain number of players into a server, please note i am not asking for the 'code' i am asking how do i do this. any help is apreciated thanks!
Using mob.Login() you add one to a global variable, lets call it, players_in, then you compare this with the number of people you want in. If you have too many people in then return and don't let them in, after that remember to continue ..()

Its one method, and you'll have to think about it :) have fun.
Since you asking the code here you go!
Well make sure you understand the code before you copy paste it :P
*******EDITED********
make sure you TAB it properly i used 3 space for 1 tab :P
*******/EDITED*******
var
Players[0] //define a list
Max_Players=10 //define the max amount of players as a number, we'll make it ten for now

client
New()
..()
if(Players.len>Max_Players) //if the Players.len is larger than Max_Players deny access
del(src)
else
Players.Add(src)


Vash_616 wrote:
can anyone show me how to code a thing that only allows a certain number of players into a server, please note i am not asking for the 'code' i am asking how do i do this. any help is apreciated thanks!
In response to Gozenko
Gozenko wrote:
Since you asking the code here you go!
Well make sure you understand the code before you copy paste it :P

Vash_616 wrote:
can anyone show me how to code a thing that only allows a certain number of players into a server, please note i am not asking for the 'code' i am asking how do i do this. any help is apreciated thanks!

He wasn't asking for code. :P
In response to Maz
Also, dont forget to mark people off on logout. You dont want to forget that.
In response to Maz
Dont use mob.Login()
Your goal is to stop ur server to get overloaded.
In that case i would say checking client connections is way better, just dont even let em connect (well they have to be to check if they can get on or not but anyways) kick em right off after saying "To bad sucker, server is full!"