22.08.2015, 22:44
PHP код:
forward TruckCheck(playerid);
public TruckCheck(playerid)
{
new attachedtrailer = GetPlayerVehicleID(playerid);
new str[128];
if (!IsPlayerInAnyVehicle(playerid) && !IsTrailerAttachedToVehicle(attachedtrailer)) {
truckTime[playerid]++;
format(str, sizeof(str), "Get back in your truck! ~n~or ~n~ Reconnect your trailer! ~n~(%d)", 30 - truckTime[playerid]);
GameTextForPlayer(playerid, str, 3000, 3);
PlayerPlaySound(playerid,1055,0.0,0.0,0.0);
if (truckTime[playerid] >= 30) {
KillTimer(truckchecktime);
StopPlayerJob(playerid);
SendClientMessage(playerid, COLOR_LIGHTGREEN, "You failed the mission!");
truckTime[playerid] = 0;
}
return 1;
}
return 0;
}