AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Only Bots (https://forums.alliedmods.net/showthread.php?t=67118)

flyeni6 02-16-2008 03:10

Only Bots
 
How can i make it so that, when there is at least 1 real person playing, there will be no timelimit. And when there is Nothing but BOTS on my server there will be a timelimit of 10 minutes?
note: my server has 9 bots

Thank you

Exolent[jNr] 02-16-2008 03:20

Re: Only Bots
 
Code:

new g_RealPlayers;
new mp_timelimit;

public plugin_init()
{
    mp_timelimit = get_cvar_pointer("mp_timelimit");
}

public client_putinserver(id)
{
    if(is_user_bot(id))
        return;
   
    if(++g_RealPlayers == 1)
        set_pcvar_num(mp_timelimit, 0);
}

public client_disconnect(id)
{
    if(is_user_bot(id))
        return;
   
    if(--g_RealPlayers == 0)
        set_pcvar_num(mp_timelimit, 10);
}



All times are GMT -4. The time now is 22:53.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.