if statement OnVehicleSpawn - HELP
#1

Код:
public OnVehicleSpawn(vehicleid)
{
  if(IsSmallVehicle(vehicleid)) {
		Vehicle[vehicleid][Fuel] = randomEx(SMALLV_GAS_MIN , SMALLV_GAS_MAX);
	}
	if(IsMidsizeVehicle(vehicleid)) {
		Vehicle[vehicleid][Fuel] = randomEx(MIDV_GAS_MIN, MIDV_GAS_MAX);
	}
	if(IsLargeVehicle(vehicleid)) {
		Vehicle[vehicleid][Fuel] = randomEx(LARGEV_GAS_MIN, LARGEV_GAS_MAX);
	}
	if(IsExLargeVehicle(vehicleid)) {
		Vehicle[vehicleid][Fuel] = randomEx(EXLARGEV_GAS_MIN, EXLARGEV_GAS_MAX);
	}
	
	return true;
}
Well after the cars spawn and i get in them it says there is no gas in the vehicle, But it if change the coding to this it works fine:


Код:
public OnVehicleSpawn(vehicleid)
{
  Vehicle[vehicleid][Fuel] = randomEx(SMALLV_GAS_MIN , SMALLV_GAS_MAX);
  return true;
}
Does anyone know why, if i check to see what car it is first it doesn't set the gas.
Reply


Messages In This Thread
if statement OnVehicleSpawn - HELP - by kevin974 - 23.06.2010, 03:28
Re: if statement OnVehicleSpawn - HELP - by bigcomfycouch - 23.06.2010, 03:36
Re: if statement OnVehicleSpawn - HELP - by kevin974 - 23.06.2010, 03:42
Re: if statement OnVehicleSpawn - FIXED - by kevin974 - 23.06.2010, 03:55

Forum Jump:


Users browsing this thread: 1 Guest(s)