Raised This Month: $ Target: $400
 0% 

[L4D2] Check if bot has IDLE:player


Post New Thread Reply   
 
Thread Tools Display Modes
cigs
Senior Member
Join Date: Jul 2006
Old 04-05-2010 , 12:57   Re: [L4D2] Check if bot has IDLE:player
Reply With Quote #11

They're all here: http://wiki.alliedmods.net/Left_4_De...s#CBasePlayer: but I wouldn't know which it is, let alone if there is one specifically for the IDLE issue here.
__________________
cigs is offline
mi123645
Veteran Member
Join Date: Feb 2009
Old 04-05-2010 , 18:55   Re: [L4D2] Check if bot has IDLE:player
Reply With Quote #12

Under the table of "SurvivorBot"

Quote:
-Member: m_humanSpectatorUserID (offset 11896) (type integer) (bits 32)
-Member: m_humanSpectatorEntIndex (offset 11900) (type integer) (bits 32)
Those may help.
mi123645 is offline
cigs
Senior Member
Join Date: Jul 2006
Old 04-05-2010 , 18:59   Re: [L4D2] Check if bot has IDLE:player
Reply With Quote #13

Thanks, MI5. Awesome!
__________________
cigs is offline
cigs
Senior Member
Join Date: Jul 2006
Old 04-13-2010 , 12:45   Re: [L4D2] Check if bot has IDLE:player
Reply With Quote #14

For those who need it:

PHP Code:
stock bool:HasIdlePlayer(bot)
{
    new 
userid GetEntData(botFindSendPropInfo("SurvivorBot""m_humanSpectatorUserID"))
    new 
client GetClientOfUserId(userid)
    
    if(
client)
    {
        
// Do not count bots
        // Do not count 3rd person view players
        
if(IsClientInGame(client) && !IsFakeClient(client) && (GetClientTeam(client)!=2))
            return 
true
    
}    
    return 
false
}

stock bool:IsClientIdle(client)
{
    for(new 
1<= MaxClientsi++)
    {
        if(!
IsClientConnected(i))
            continue
        if(!
IsClientInGame(i))
            continue
        if(
GetClientTeam(i)!=2)
            continue
        if(!
IsFakeClient(i))
            continue
        if(!
HasIdlePlayer(i))
            continue
        
        new 
spectator_userid GetEntData(iFindSendPropInfo("SurvivorBot""m_humanSpectatorUserID"))
        new 
spectator_client GetClientOfUserId(spectator_userid)
        
        if(
spectator_client == client)
            return 
true
    
}
    return 
false

__________________

Last edited by cigs; 04-13-2010 at 19:12.
cigs 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 20:43.


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