02.02.2017, 02:41
You can use Streamer_GetNearbyItems to get all the near by items streamed.
Usage example:
pawn Код:
native Streamer_GetNearbyItems(Float:x, Float:y, Float:z, type, STREAMER_ALL_TAGS items[], maxitems = sizeof items, Float:range = 300.0);
pawn Код:
const
MAX_OBJECTS_ON_RANGE = 150,
Float:MAX_VISIBLE_RANGE = 250.0
;
new streamerObjectArray[MAX_OBJECTS_ON_RANGE] = {-1, ...};
//To hold all the objects visible on a range.
new
Float:fX, Float:fY, Float:fZ;
GetPlayerPos(playerid, fX, fY, fZ);
Streamer_GetNearbyItems(fX, fY, fZ, STREAMER_TYPE_OBJECT, streamerObjectArray, sizeof(streamerObjectArray), MAX_VISIBLE_RANGE);
//streamerObjectArray now holds the ids of visible objects of "playerid".
for(new i = 0; streamerObjectArray[i] != -1; i++) //Loop through