Problem with Iterators
#5

Not sure, but Try this
Код:
new
	Iterator:OwnedVehicle[MAX_PLAYERS]<MAX_VEHICLES>;
Iter_Init(OwnedVehicle);
// Add vehicles to players here...
Iter_Add(OwnedVehicle[playerid], 42);
Iter_Add(OwnedVehicle[playerid], 43);
Iter_Add(OwnedVehicle[playerid], 44);
// Other code...
foreach (new vehicleid : OwnedVehicle[playerid])
{
	printf("Player %d owns vehicle %d", playerid, vehicleid).
}
Use Iter_Init(iterator_name) and see the results.
Source: https://sampforum.blast.hk/showthread.php?tid=570937

The first method is a little bit insufficient as it uses lots of slots,
try this method:
PHP код:
Iterator:OwnedVehicles<MAX_PLAYERSMAX_VEHICLES>;
Iterator:InJob<MAX_PLAYERS16>; 
Reply


Messages In This Thread
Problem with Iterators - by RedGun2015 - 09.09.2017, 00:40
Re: Problem with Iterators - by Eoussama - 09.09.2017, 00:42
Re: Problem with Iterators - by RedGun2015 - 09.09.2017, 00:43
Re: Problem with Iterators - by Pottus - 09.09.2017, 00:47
Re: Problem with Iterators - by Eoussama - 09.09.2017, 00:49
Re: Problem with Iterators - by RedGun2015 - 09.09.2017, 00:56
Re: Problem with Iterators - by Pottus - 09.09.2017, 01:03

Forum Jump:


Users browsing this thread: 1 Guest(s)