Raised This Month: $51 Target: $400
 12% 

Only Bots


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
flyeni6
Senior Member
Join Date: Jun 2006
Location: CAli
Old 02-16-2008 , 03:10   Only Bots
Reply With Quote #1

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
__________________

flyeni6 is offline
Send a message via AIM to flyeni6
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 02-16-2008 , 03:20   Re: Only Bots
Reply With Quote #2

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);
}
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:36.


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