Quote:
playersInVicinity = find_ent_sphere(0,origin,vicinity,"player",6, entList,0)
|
that interface was changed from jghg > jghg2 module
and btw if you allow *0* entities to be stored in entList I guess you will only ever get *0* returned from that native cause it's supposed to return number of ents stored in entList. I think you should've allow at least one in this case... I've probably missed this earlier also. Jeez, who makes these hard-to-use natives anyway?
Quote:
/* Returns first found ent from start_from_ent in a sphere with radius around origin.
* Note: this native has changed behaviour since previous versions.
*/
native find_ent_sphere(start_from_ent, Float rigin[3], Float:radius);
/* As above, but returns number of ents stored in entlist. Use to find a specific type of entity classname (specify in _lookforclassname) around a
* certain entity specified in aroundent. All matching ents are stored in entlist. Specify max amount of entities to find in maxents.
* If aroundent is 0 its origin is not used, but origin in 6th parameter. Ie, do not specify 6th parameter (origin) if you specified an entity
* in aroundent.
*/
native find_sphere_class(aroundent, _lookforclassname[], Float:radius, entlist[], maxents, Float rigin[3] = {0.0, 0.0, 0.0});
|
Neither of them are in engine yet.
*however* looking at your code I don't think using find_ent_sphere (or find_sphere_class which really just uses find_ent_sphere internally) is a good idea (I guess you coopied my (bad) idea from I spy?). A better way to find out if some playesr already exist at an origin is to get_players(), then check their distance from the origin using get_distance(). I think find_ent_sphere does this but on all ents in game (can be hundreds).