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

Bot face entity?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Civiccod PRO
Member
Join Date: Nov 2012
Old 06-12-2013 , 00:10   Bot face entity?
Reply With Quote #1

Hey, I was wondering how do you make a bot face an entity? Pretty much sums it up in the title.

Say a projectile was thrown somewhere, the bot would face that projectile.
__________________
Available for private plugins at request.

Contact Me
Civiccod PRO is offline
Impact123
Veteran Member
Join Date: Oct 2011
Location: Germany
Old 06-12-2013 , 05:49   Re: Bot face entity?
Reply With Quote #2

This should contain the basic logic you need to know in order to be able to write a function for your purpose.

Yours sincerely
Impact
__________________

Last edited by Impact123; 06-12-2013 at 05:53.
Impact123 is offline
Civiccod PRO
Member
Join Date: Nov 2012
Old 06-12-2013 , 05:54   Re: Bot face entity?
Reply With Quote #3

Thank you. I'll test it out, finally somebody replied
__________________
Available for private plugins at request.

Contact Me
Civiccod PRO is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 06-12-2013 , 07:38   Re: Bot face entity?
Reply With Quote #4

That should only make the bot face the player if the player is looking directly at the bot. If you're trying to make it so it doesn't matter where the player is looking, you might want to try something like this:

PHP Code:
new Float:vecClientEyePos[3], Float:vecTargetEyePos[3], Float:vecTargetEyeAng[3];
GetClientEyePosition(clientvecClientEyePos);
GetClientEyePosition(targetvecTargetEyePos);

MakeVectorFromPoints(vecTargetEyePosvecClientEyePosvecTargetEyeAng);
GetVectorAngles(vecTargetEyeAngvecTargetEyeAng);

TeleportEntity(targetNULL_VECTORvecTargetEyeAngNULL_VECTOR); 
bl4nk is offline
Civiccod PRO
Member
Join Date: Nov 2012
Old 06-12-2013 , 08:00   Re: Bot face entity?
Reply With Quote #5

Oh, thanks, I was wondering lol. Early in the mourning, no sleep.
__________________
Available for private plugins at request.

Contact Me
Civiccod PRO 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 01:50.


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