DetachTrailer
#1

The trailer disconnect at a sharp bend and the GameTextForPlayer pops out that it has 30 seconds to connect the trailer, if it does not connect the trailer it will be respawn and the mission is canceled. How to make?
Reply
#2

You should create a time (settime) with a value of 30 seconds telling you that it is for him to get the trailer, of course one must also create the functions inside the callbeck that will be called when the time is finished, simple thing

- Useful functions:
https://sampwiki.blast.hk/wiki/SetTimerEx
https://sampwiki.blast.hk/wiki/DisablePlayerCheckpoint
https://sampwiki.blast.hk/wiki/GameTextForPlayer

demo:
Код:
forward FinishMissionTrucking(playerid);
forward TuckerCheckTrail(playerid);

new TrailerToWork[MAX_PLAYERS];

CMD:startmission(playerid){
    new TrailerToWork[playerid] = GetVehicleTrailer(vehicleid);
    SetTimerEx("TuckerCheckTrail", 1000, false, "i", playerid);
    return 1;
}
public TuckerCheckTrail(playerid){
    if(!IsTrailerAttachedToVehicle(TrailerToWork[playerid])){
        GameTextForPlayer(playerid, "Warning: Grab the trailer before the time runs out!", 5000, 2);
        SetTimerEx("FinishMissionTrucking", 30000, false, "i", playerid);
    }
    return 1;
}

public FinishMissionTrucking(playerid) return /*function to destroy the mission*/
Reply
#3

Somehow it does not work. I did TimersT(playerid) instead of a command.

https://pastebin.com/gYNf1TDY
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)