GetNearestsVehicles without cikle.
#2

One way would be foreach/y_iterate. Add to an iterator the streamed vehicles and loop through them. You have to use the old multi-iterator method though.

An example:
pawn Код:
// global:
static
    Iterator: gPlayerStreamedVehicles[MAX_PLAYERS]<MAX_VEHICLES>;
   
// OnGameModeInit:
Iter_Init(gPlayerStreamedVehicles);

// OnPlayerConnect:
Iter_Clear(gPlayerStreamedVehicles[playerid]);

public OnVehicleStreamIn(vehicleid, forplayerid)
{
    Iter_Add(gPlayerStreamedVehicles[forplayerid], vehicleid);
    return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
    Iter_Remove(gPlayerStreamedVehicles[forplayerid], vehicleid);
    return 1;
}

// somewhere:
foreach (new v : gPlayerStreamedVehicles[playerid])
{
    // "v" vehicleid is streamed in
}
Reply


Messages In This Thread
GetNearestsVehicles without cikle. - by ScIrUsna - 11.04.2016, 13:38
Re: GetNearestsVehicles without cikle. - by Konstantinos - 11.04.2016, 15:09
Re: GetNearestsVehicles without cikle. - by ScIrUsna - 11.04.2016, 15:34
Re: GetNearestsVehicles without cikle. - by Crayder - 11.04.2016, 16:20

Forum Jump:


Users browsing this thread: 1 Guest(s)