View Single Post
Author Message
diorfo
Member
Join Date: Dec 2013
Old 11-26-2018 , 21:48   [L4D2] Send Players to Spec on Connect
Reply With Quote #1

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 
1<= MaxClientsi++)
    {
        if (
&& IsClientInGame(i) && !IsFakeClient(i))
        {
NotBots++;}
    }

    new 
AdminId:admin FindAdminByIdentity(AUTHMETHOD_STEAMsteamID);

    if (
NotBots && !IsFakeClient(admin) && !GetAdminFlag(adminAdmin_Kick))
 
    {
        
ChangeClientTeam(admin1);        
    }     

Is there a Forward similar to OnClientPutInServer but triggered only on player enter in server for first time to me put on my plugin?

Last edited by diorfo; 11-29-2018 at 06:33.
diorfo is offline