18.02.2010, 19:20
Quote:
Originally Posted by BlackFoX_UD_
vehicleid isnt the Model of Vehicle
Код:
(vehicleid = GetVehicleModel(vehicleid) |
Another version which does the same thing
pawn Код:
stock GetVehicleMaxSeats(vehicleid)
if((vehicleid = GetVehicleModel(vehicleid))) return VehicleSeats[vehicleid - 400]; else return 0;
pawn Код:
stock GetVehicleMaxSeats(vehicleid) {
vehicleid = GetVehicleModel(vehicleid);
if(vehicleid) return VehicleSeats[vehicleid - 400];
else return 0;
}
2. Line: We check if the saved modelid is logical true (means != 0) and return the seats number from (vehicleid[which stores the modelid] - 400)
3. Line: If the check fails (also vehicleid is logical false ( == 0)) we return 0;
Vehicleid is just a variable name, nothing else - you can store any number in it
pawn Код:
stock GetVehicleMaxSeats(var)
if((var = GetVehicleModel(var))) return VehicleSeats[var - 400]; else return 0;