mikzy Untested, but I left some comments that should make it easy to figure out.
hasVipStatus() {
/*
Conduct your VIP status check here
*/
return status;
}
/*
Returns bool on whether room was made for the VIP player
vip_slots - The amount of VIP slots on the server
*/
makeVipRoom(vip_slots) {
room_made = false;
if(level.players.size >= vip_slots) { // If there's as many or more players as there are vip slots, we need to kick someone who isn't vip
for(i = 0; i < level.players.size; i++) { // Iterate over each player in the server
player = level.players[i];
if(!player isHost() && !player hasVipStatus()) { // If the player isn't host and isn't vip
// The iterator index should be the same as the entity number in this case (I think)
kick(i); // Kick the non-vip player
room_made = true;
break;
}
}
}
return room_made;
}
makeVipRoom()
returns a boolean on whether room was made or not. Maybe you could use it to send an error or something to the player that there's no room available.