Hi all,
I need a little help with a simple code for a plugin that i'm trying to put in my server.
I need a plugin that sends players to spec on connect after certain numbers of players in game even with bots in game also.
I found the plugin
https://forums.alliedmods.net/showthread.php?p=892093 but doesn't work properly anymore.
I tried to develop the plugin with code below but every map changes the plugin sends players already connected and playing to spec because
OnClientPutInServer is triggered after every map load.
PHP Code:
public OnClientPutInServer(client) {
new NotBots = 0;
for(new i = 1; i <= MaxClients; i++)
{
if (i > 0 && IsClientInGame(i) && !IsFakeClient(i))
{NotBots++;}
}
new AdminId:admin = FindAdminByIdentity(AUTHMETHOD_STEAM, steamID);
if (NotBots > 8 && !IsFakeClient(admin) && !GetAdminFlag(admin, Admin_Kick))
{
ChangeClientTeam(admin, 1);
}
}
Is there a Forward similar to
OnClientPutInServer but triggered only on player enter in server for first time to me put on my plugin?