24.04.2018, 19:51
Use Phreak's code above to create the trailers, once you've created the trailers,
under OnPlayerUpdate,
If you wanna add the label to the trailers just use Attach3DTextLabelToVehicle under OnGameModeInit (or wherever you create the trailers)
Then under OnDialogResponse it will simply look something like this
and then the event that happens when the player enters the destination under OnPlayerEnterCheckpoint
Give it ago, if you get stuck, ask for some more help.
(not tested any of this, but it will most likely work)
under OnPlayerUpdate,
Код:
if(GetVehicleTrailer(vID) == ID_trailer[0]) //trailer 1 (ls) { ShowPlayerDialog(playerid, /*MISSION_1*/997, DIALOG_STYLE_MSGBOX, "INFO", "Point: Shop LS\nPrize: 5000$", "Yes", "No"); } else if(GetVehicleTrailer(vID) == ID_trailer[1]) //trailer 2 lv { ShowPlayerDialog(playerid, /*MISSION_2*/998, DIALOG_STYLE_MSGBOX, "INFO", "Point: Shop LV\nPrize: 5000$", "Yes", "No"); } else if(GetVehicleTrailer(vID) == ID_trailer[3]) //trailer 3 sf { ShowPlayerDialog(playerid, /*MISSION_3*/999, DIALOG_STYLE_MSGBOX, "INFO", "Point: Shop SF\nPrize: 5000$", "Yes", "No"); }
Then under OnDialogResponse it will simply look something like this
Код:
if(dialogid == 999 && response) { SetPlayerCheckpoint(playerid, /*x, y, z, size*/); SetPVarInt(playerid, "trucking", 1); }
Код:
if(GetPVarInt(playerid, "trucking") == 1) { DeletePVar(playerid, "trucking"); SendClientMessage(playerid, 1, "Congratulations"); //whatever else you wanna do }
(not tested any of this, but it will most likely work)