//OnPlayerEnterVehicle
if(engine == VEHICLE_PARAMS_UNSET) switch(GetVehicleModel(vehicleid)) {
case 509, 481, 510: VehicleFuel[vehicleid] = 100, arr_Engine{vehicleid} = 1, SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
default: SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_OFF,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective), arr_Engine{vehicleid} = 0;
}
new pveh = GetVehicleModel(GetPlayerVehicleID(playerid));
if(pveh == 510 || pveh == 462 || pveh == 481 || pveh == 509)
{
arr_Engine{vehicleid} = 1;
GetVehicleParamsEx(pveh,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(pveh, 1, lights, 0, 0, 0, 0, 0);
}
//OnPlayerStateChange under if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
new engine,lights,alarm,doors,bonnet,boot,objective, vehicleid;
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
if(GetVehicleModel(vehicleid) == 509 || GetVehicleModel(vehicleid) == 481 || GetVehicleModel(vehicleid) == 510)
{
VehicleFuel[vehicleid] = 100;
arr_Engine{vehicleid} = 1;
SetVehicleParamsEx(vehicleid, 1, lights, alarm, doors, bonnet, boot, objective);
}
vehicleid - The ID of the vehicle to set the parameters of. engine - Engine status. 0 - Off, 1 - On. lights - Light status 0 - Off, 1 - On. alarm - Vehicle alarm status. If on, the alarm starts. 0 - Off, 1 - On. doors - Door lock status. 0 - Unlocked, 1 - Locked. bonnet - Bonnet (hood) status. 0 - Closed, 1 - Open. boot - Boot/trunk status. 0 - Closed, 1 - Open. objective - Toggle the objective arrow above the vehicle. 0 - Off, 1 - On. |
SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_OFF,VE HICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective ) |