20.05.2015, 19:31
You'd want to save and declare a variable for how many vehicle slots are CURRENTLY avaliable, NO LOOPING IS NEEDED if you just want to limit the dealership stock:
e.g:
However, if you only want 10 infernuses on the whole server you can either keep a variable or query MySQL to see if there are 10 rows / data selections.
e.g:
pawn Код:
new gStock[MAX_VEHICLE_MODELS][MAX_VEHICLE_DEALERSHIPS];
// when they buy it
if(gStock[vehiclemodel][dealership] == 0) return SendClientMessage(playerid, -1, "That item is not in stock.");
gStock[vehiclemodel][dealership]--;