07.10.2017, 16:20
How to make if the player dies to trigger FailJob(playerid); and kill the timer?
PHP код:
case ClassRoadWorker:
{
// Check if the roadworker has a job
if (APlayerData[playerid][JobStarted] == true)
{
// Check if the vehicletimer didn't run out yet
if (APlayerData[playerid][VehicleTimerTime] != 0)
{
if ((OldVehicleID == NewVehicleID) && (OldTrailerID == NewTrailerID))
APlayerData[playerid][VehicleTimerTime] = Job_TimeToFailMission;
else // VehicleID isn't still the same (player lost his vehicle or trailer)
PlayerLeftVehicle(playerid); // Inform the player that he left his vehicle and that he must re-enter it
}
else // Time left has reached 0
FailJob(playerid);
}
}