Description
This plugins is allowing VIP (clients with the reservation flag) to join a full server, it will kick the client that was last connected to the server. However, if an Admin (clients with the ban flag) joins, it will allow them in but not kick the last connected client.
This plugin is made for 5v5 servers with 11 slots, check out the Modifications tab how to configure the plugin for your server!
Installation
Download the CustomReservedslots.smx file
Put it in your plugins folder (/addons/sourcemod/plugins/)
Delete the default reserved slot plugin file (/addons/sourcemod/plugins/reservedslots.smx)
Either change map or run "sm_rcon sm plugins refresh" in your console (to load the plugin)
The plugin is now loaded and working
Modifications
Spoiler
This plugin is mainly made for 5v5 servers with 11 slots. If your server has more/less slots, you have to change the MAX_SERVER_SLOTS value.
To do that, go to line 10 and change the value from 11 to whatever amount of slots you have on your server.
public Plugin myinfo =
{
name = "CustomReservedslots",
author = "Trum",
description = "Allow VIP & Admins to join full servers, kick normal players to let a free slot for VIP",
version = "1.0",
url = ""
}
public void OnClientPostAdminCheck(int client)
{
int iPlayers = 0;
if(!CheckCommandAccess(client, "", ADMFLAG_RESERVATION, true) && !CheckCommandAccess(client, "", ADMFLAG_BAN, true))
{
CreateTimer(0.1, OnTimedKickForReject, GetClientUserId(client));
}
else if(CheckCommandAccess(client, "", ADMFLAG_RESERVATION, true))
{
int time = 0x7fffffff;
int lastConnectedClient;
for(int i = 1; i <= MaxClients; i++)
{
if(IsValidClient(i) && !CheckCommandAccess(i, "", ADMFLAG_RESERVATION, true) && !CheckCommandAccess(i, "", ADMFLAG_BAN, true))
{
if(time > GetClientTime(i))
{
time = GetClientTime(i);
lastConnectedClient = i;
}
}
}
if(!CheckCommandAccess(client, "", ADMFLAG_BAN, true))
KickClient(lastConnectedClient, "You have been kicked because a VIP joined.\n\nPurchase VIP to get access to full servers!\n\nStore: www.website.com");
}
}
}
public Action OnTimedKickForReject(Handle timer, any userid)
{
int client = GetClientOfUserId(userid);