FailJob problem etc.
#1

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);
                    }
                } 
Reply
#2

try this
public OnPlayerDeath
{
FailJob(playerid);
return 1;
}
if you already have public command just put FailJob above return
Reply
#3

Thank you man, it solved my problem!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)