Raised This Month: $ Target: $400
 0% 

Is Player Controlling a Bot?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 09-24-2013 , 09:13   Re: Is Player Controlling a Bot?
Reply With Quote #5

Quote:
Originally Posted by 11530 View Post
Might still be prudent to check if the netprop exists in the first place, at the expense of using OnPluginStart too (unless you don't mind checking it's availability every use). Also handles FindSendPropInfo returning 0 too, though this code could be used for any boolean netprop, mind you.
PHP Code:
new bool:g_bIsAvailable;

public 
OnPluginStart()
{
    
g_bIsAvailable = (FindSendPropInfo("CBasePlayer""m_bIsControllingBot") > 0);
}

bool:IsPlayerControllingBot(const client
{
    return (
g_bIsAvailable && GetEntProp(clientProp_Send"m_bIsControllingBot") == 1);

...in a game-specific plugin?
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
 



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:35.


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