26.01.2018, 23:58
I didn't realize you could do this.
Why would you do that? That pretty much makes this function useless if there is two or more actors. It should at least have an optional parameter to do what you are doing otherwise update your code to find the closest actor and return it.
Код:
enum _:E_TYPE_SEARCH(<<= 1) { SEARCH_TYPE_DYNAMIC = 1, SEARCH_TYPE_STATIC, SEARCH_TYPE_ALL = SEARCH_TYPE_DYNAMIC | SEARCH_TYPE_STATIC }
Код:
I was looking at a few things here and this doesn't make sense to me. if(type & SEARCH_TYPE_STATIC) { foreach(new i : Static_Actors) { if(!IsPlayerInRangeOfPoint(playerid, range, Static_Actors[i][eapPosX], Static_Actors[i][eapPosY], Static_Actors[i][eapPosZ])) continue; if(actorid != INVALID_ACTOR_ID) return MULTIPLE_TARGET_FOUND; actorid = i; } }