Raised This Month: $ Target: $400
 0% 

Check if player is in radius of entity?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 05-31-2007 , 15:57   Re: Check if player is in radius of entity?
Reply With Quote #1

This should be the engine I'm assuming...

Code:
#include <engine> new Float:radius = 300.0; new ent = -1; new entClass[32]; while((ent = find_ent_in_sphere(ent, forigin, radius)) != 0) {     entity_get_string(ent, EV_SZ_classname, entClass, 31);     if(contain(entClass, "info_") != 0)     {         // found entity ;)     } }

Last edited by hlstriker; 05-31-2007 at 16:07.
hlstriker is offline
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 05-31-2007 , 16:33   Re: Check if player is in radius of entity?
Reply With Quote #2

When trying to compile I get a tag mismatch on this line...
entity_get_string(ent, EV_SZ_classname, entClass, 31);

Also, should this line be a 0 or -1 at the end...?
while((ent = find_ent_in_sphere(ent, forigin, radius)) != 0)
hlstriker 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 22:24.


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