30.03.2019, 12:05
I have a problem.
A player with ID 0 will attach a trailer and a dialogue with the mission pops up. (Well)
A player with ID 1 will attach a trailer and do not show dialogue with the mission. (Wrong)
Why? How to fix it so that they show a dialogue with the mission for other IDs.
A player with ID 0 will attach a trailer and a dialogue with the mission pops up. (Well)
A player with ID 1 will attach a trailer and do not show dialogue with the mission. (Wrong)
Why? How to fix it so that they show a dialogue with the mission for other IDs.
Код:
new MissionStatus[MAX_PLAYERS];
enum mlInfo
{
TrailerID[10],
TrailerMissionID,
TrailerMissionStatus[15],
TrailerMissionName[25],
Float:TrailerMissionUnloadX,
Float:TrailerMissionUnloadY,
Float:TrailerMissionUnloadZ,
TrailerMissionPayMoney,
TrailerMissionPayScore
}
new TrailerMissionLocation[][mlInfo] =
{
{0, 0, "Legal", "Dillimore", 610.9240, -590.9404, 17.2266, 100, 1},
{1, 1, "Illegal", "El Quebrados", -1499.8832, 2533.9829, 55.6875, 200, 2}
};
public OnGameModeInit()
{
SetTimer("OnTrailerUpdateXX", 1000, true);
TrailerMissionLocation[0][TrailerID] = CreateVehicle(435, 2749.8076, 2628.5588, 11.4041, 206.2215, 1, 1, 60); // TrailerLV
TrailerMissionLocation[1][TrailerID] = CreateVehicle(435, 2756.3267, 2628.5952, 11.4061, 206.6927, 1, 1, 60); // TrailerLV
return 1;
}
forward OnTrailerUpdateXX(playerid, vehicleid);
public OnTrailerUpdateXX(playerid, vehicleid)
{
new vID = GetPlayerVehicleID(playerid);
new string[250];
if(MissionStatus[playerid] == 0)
{
if(GetVehicleTrailer(vID) == TrailerMissionLocation[0][TrailerID])
{
ShowPlayerDialog(playerid, 700, DIALOG_STYLE_MSGBOX, "Info", "Mission 1", "Yes", "Cancel");
}
else if(GetVehicleTrailer(vID) == TrailerMissionLocation[1][TrailerID])
{
ShowPlayerDialog(playerid, 701, DIALOG_STYLE_MSGBOX, "Info", "Mission 2", "Yes", "Cancel");
}
}
return 0;
}

