Is this possible?
#1

That when a trailer disconnects from a truck, that it cancels a checkpoint?
Reply
#2

It is possible.
Reply
#3

Quote:
Originally Posted by tuuker
Посмотреть сообщение
It is possible.
Ah nice, how would you go about doing it?
Reply
#4

Have a timer running for every player that checks if the trailer is still connected to your vehicle.

First store the vehicleid of the attached trailer somewhere.
Then start a timer which runs every second and let that timer check if vehicleid of the attached trailer is still the same as you stored before.
If it's the same, do nothing.
If it's not the same, cancel the checkpoint (and perhaps kill the timer).
Reply
#5

pawn Код:
new Timer[MAX_PLAYERS];

forward CheckAttached(playerid);
public CheckAttached(playerid);
{
    new veh = GetPlayerVehicleID(playerid);
    if(!IsTrailerAttachedToVehicle(veh)) return DisablePlayerCheckpoint(playerid);
    KillTimer(Timer[playerid]);
}

Timer[playerid] = SetTimerEx("CheckAttached", 1000, 1, "i", vehicleid); // When you attach trailer or create the checkpoint
Reply
#6

Thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)