25.01.2012, 18:51
Something like this might give you an idea;
Still very rough though, and you will also need some checks to prevent Out Of Bounds errors.
pawn Код:
enum vStat { CurrentIndex = 0, CurrentVehicleId };
new gVehicleShopStat[MAX_PLAYERS][vStat]; // If only 1 person can browse at a time, remove the max players
// When creating the first vehicle
gVehicleShopStat[playerid][CurrentIndex] = 0;
gVehicleShopStat[playerid][CurrentVehicleId] = CreateVehicle(gVehicleShopStat[playerid][CurrentIndex], x, y, z, ...);
// When going to the next vehicle
DestroyVehicle(gVehicleStopStat[playerid][CurrentVehicleId]);
gVehicleShopStat[playerid][CurrentVehicleId] = CreateVehicle(++gVehicleShopStat[playerid][CurrentIndex], x, y, z, ...);

