Raised This Month: $ Target: $400
 0% 

Is Player Controlling a Bot?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 09-21-2013 , 18:12   Is Player Controlling a Bot?
Reply With Quote #1

Thought I posted this before in here, but I think I've only posted it in the CSS Bank plugin thread... Anyways, for CS:GO (and maybe others), here's a good way to check if a client is controlling a bot (thanks asherkin):

bad way

PHP Code:
/**
 * Check if a player is controlling a bot
 * @param    client    Player's client index
 * @return    True if player is controlling a bot, false otherwise
 */
bool:IsPlayerControllingBot(client)  

    static 
bool:hasChecked false
    static 
bool:isAvailable false
    if (!
hasChecked) { 
        
isAvailable FindSendPropOffs("CBasePlayer""m_bIsControllingBot") != -1
        
hasChecked true
    } 

    return 
isAvailable && GetEntProp(clientProp_Send"m_bIsControllingBot") == 1

__________________
View my Plugins | Donate

Last edited by TnTSCS; 09-24-2013 at 17:32.
TnTSCS is offline
 


Thread Tools
Display Modes

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 18:34.


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