Raised This Month: $ Target: $400
 0% 

Is Player Controlling a Bot?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 09-24-2013 , 14:49   Re: Is Player Controlling a Bot?
Reply With Quote #7

Quote:
Originally Posted by 11530 View Post
No. For example, any plugin which could be labelled as [ANY] whilst still having netprops/datamaps which might not necessarily work in a certain game.
The correct way to implement that is with |static| anyway.
FindSendPropOffs is also more performant for this case.
const-qualifying the param also means nothing.

PHP Code:
bool:IsPlayerControllingBot(client
{
    static 
bIsAvailable FindSendPropOffs("CBasePlayer""m_bIsControllingBot") != -1;
    return 
bIsAvailable && GetEntProp(clientProp_Send"m_bIsControllingBot") == 1;

__________________

Last edited by asherkin; 09-24-2013 at 14:50.
asherkin 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:34.


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