02.12.2010, 12:02
(
Последний раз редактировалось smeti; 26.12.2010 в 18:54.
Причина: Rename IsVehicleTypeOn to GetVehicleParams
)
pawn Код:
enum
V_Type
{
ENGINE,
LIGHTS,
ALARM,
DOORS,
BONNET,
BOOT,
OBJECTIVE
};
stock
GetVehicleParams(vehicleid, V_Type:type)
{
if(vehicleid < 1) return INVALID_VEHICLE_ID;
new
GetStatus,
None;
switch(type)
{
case ENGINE: GetVehicleParamsEx(vehicleid, GetStatus, None, None, None, None, None, None);
case LIGHTS: GetVehicleParamsEx(vehicleid, None, GetStatus, None, None, None, None, None);
case ALARM: GetVehicleParamsEx(vehicleid, None, None, GetStatus, None, None, None, None);
case DOORS: GetVehicleParamsEx(vehicleid, None, None, None, GetStatus, None, None, None);
case BONNET: GetVehicleParamsEx(vehicleid, None, None, None, None, GetStatus, None, None);
case BOOT: GetVehicleParamsEx(vehicleid, None, None, None, None, None, GetStatus, None);
case OBJECTIVE: GetVehicleParamsEx(vehicleid, None, None, None, None, None, None, GetStatus);
}
return GetStatus; // (-1 VEHICLE_PARAMS_UNSET) (0 VEHICLE_PARAMS_OFF) (1 VEHICLE_PARAMS_ON)
}
pawn Код:
stock
GetVehicleParams(vehicleid, V_Type:type)
{
if(vehicleid < 1) return INVALID_VEHICLE_ID;
new
engine,
lights,
alarm,
doors,
bonnet,
boot,
objective;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
switch(type)
{
case P_ENGINE: return engine;
case P_LIGHTS: return lights;
case P_ALARM: return alarm;
case P_DOORS: return doors;
case P_BONNET: return bonnet;
case P_BOOT: return boot;
case P_OBJECTIVE: return objective;
}
return VEHICLE_PARAMS_UNSET;
}
pawn Код:
if(GetVehicleParams(GetPlayerVehicleID(playerid), ENGINE) == VEHICLE_PARAMS_ON)
{
// etc...