09.12.2012, 14:36
pawn Код:
stock GetFreeVehiclePlate()
{
for(new v = 0; v < MAX_VEHICLES; v ++)
{
new const charset[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
new VPlate[8]; // don't waste resources
format(VPlate, sizeof(VPlate), "%c%c%c - %03d", charset[random(sizeof(charset))], charset[random(sizeof(charset))], charset[random(sizeof(charset))], (100 + random(900)));
if(strcmp(Vehicles[v][Plate], VPlate, true)) return v;
}
return -1;
}