13.07.2012, 05:08
UNTESTED
pawn Код:
//On Top
new TruckTimer[MAX_PLAYERS];
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(GetPlayerVehicleID(playerid) == JobInfo[JOB_TRUCKER][jCars][0] || GetPlayerVehicleID(playerid) == JobInfo[JOB_TRUCKER][jCars][1] || GetPlayerVehicleID(playerid) == JobInfo[JOB_TRUCKER][jCars][2] || GetPlayerVehicleID(playerid) == JobInfo[JOB_TRUCKER][jCars][3] || GetPlayerVehicleID(playerid) == JobInfo[JOB_TRUCKER][jCars][4])
{
TruckTimer[playerid] = SetTimerEx("IsTrailer",1000,true,"i",playerid);
}
return 1;
}
forward IsTrailer(playerid);
public IsTrailer(playerid)
{
//Check if trailer is attached
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
if(GetPlayerVehicleID(playerid) == JobInfo[JOB_TRUCKER][jCars][0] || GetPlayerVehicleID(playerid) == JobInfo[JOB_TRUCKER][jCars][1] || GetPlayerVehicleID(playerid) == JobInfo[JOB_TRUCKER][jCars][2] || GetPlayerVehicleID(playerid) == JobInfo[JOB_TRUCKER][jCars][3] || GetPlayerVehicleID(playerid) == JobInfo[JOB_TRUCKER][jCars][4])
{
KillTimer(TruckTimer[playerid]);
}
return 1;
}