Код:
PlayerLeftVehicle(playerid)
{
// Setup local variables
new TimeLeft[5];
// Reduce the time left by 1
APlayerData[playerid][VehicleTimerTime] = APlayerData[playerid][VehicleTimerTime] - 1;
// Convert the time left to a string for displaying
valstr(TimeLeft, APlayerData[playerid][VehicleTimerTime]);
// Display the time left
// Send only one message to inform the player what he must do
if (APlayerData[playerid][VehicleTimerTime] == (Job_TimeToFailMission - 1))
{
// Check the class of the player and inform them what to do
switch (APlayerData[playerid][PlayerClass])
{
case Trucker:
{
if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)) == 0)
{
new RouteText[50];
format(RouteText, 50, "re trailer your truck ~n~%s", TimeLeft);
TextDrawSetString(APlayerData[playerid][MissionText], RouteText);
}
if(IsPlayerInAnyVehicle(playerid) == 0)
{
new RouteText[50];
format(RouteText, 50, "Get back in your vehicle!~n~%s", TimeLeft);
TextDrawSetString(APlayerData[playerid][MissionText], RouteText);
}
}
case BusDriver:
{
SendClientMessage(playerid, 0xFFFFFFFF, TXT_BusDriverMustEnterBus);
new string[64];
//format(string,sizeof(string),"Get back in veh ~n~%s", TimeLeft);
GameTextForPlayer(playerid, string, 1000, 4);
}
case Courier:
{
SendClientMessage(playerid, 0xFFFFFFFF, TXT_CourierMustEnterVehicle);
}
case RoadWorker:
{
SendClientMessage(playerid, 0xFFFFFFFF, TXT_RoadworkerMustEnterVehicle);
}
}
}
}