22.08.2015, 19:11
Maybe something like this will work
PHP код:
new trckTime[MAX_PLAYERS];
forward TruckCheck(playerid);
public TruckCheck(playerid)
{
if (IsPlayerInAnyVehicle(playerid) == 0) {
truckTime[playerid]++;
new str[64];
format(str, sizeof(str), "Get back in your truck! [time left %d]", 10 - truckTime[playerid]);
GameTextForPlayer(i, str, 1000, 3);
if (truckTime[playerid] >= 10) {
// Do stuff here
truckTime[playerid] = 0;
}
return 1;
}
else if (IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)) == 0)
{
GameTextForPlayer(playerid, "Reconnect your trailer!", 1000, 5);
return 1;
}
return 0;
}