AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   find_ent_in_sphere (https://forums.alliedmods.net/showthread.php?t=24873)

mysticssjgoku4 03-04-2006 03:20

find_ent_in_sphere
 
Ok, I've been trying to code this and have been debugging, the problem is, it keeps finding the fucking player in the ent sphere and returning it. How can I bypass this, because even when I'm look or on top of my item_c4 ent, it says "[ItemMod] Classname: player".

-_-


Please help me on this, all of these ent commands seems to not work as easy as they are described in the docs.

Kraugh 03-04-2006 03:57

try this.

Code:
new ent, classname[32], foundBomb; while( (ent = find_ent_in_sphere(ent,forigin,50.0)) != 0 ) {    entity_get_string(ent,EV_SZ_classname,classname,31);    if(equali(classname,"item_c4")) {       foundBomb = ent;       break;    } }

this loops through all the entities in the sphere and checks for item_c4's. if it finds one it saves it into foundBomb.

mysticssjgoku4 03-04-2006 06:04

That Worked, Thanks.


All times are GMT -4. The time now is 20:21.

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