24.03.2013, 21:37
It's showing message whenever you enter ANY vehicle, and it should only display the dialog when you enter [0] - [7] car...
It should work like if you enter vehicle from Dschool[0] to Dschool[7] it will display the dialog. But currently it's showing the dialog if you enter ANY vehicle.
Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new CarCheck = GetPlayerVehicleID(playerid);
if(CarCheck == DSchool[0] || DSchool[1] || CarCheck == DSchool[2] || CarCheck == DSchool[3] || CarCheck == DSchool[4] || CarCheck == DSchool[5]
|| CarCheck == DSchool[6] || CarCheck == DSchool[7])
{
if(PlayerInfo[playerid][pDriversLic] == 0)
{
ShowPlayerDialog(playerid, DRIVERS_TEST, DIALOG_STYLE_MSGBOX, "Notice", "Would you like to take drivers test?\nIt will cost you 50$", "Yes", "No");
return 1;
}
else
{
return 1;
}
}
else
{
return 1;
}
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
new CarCheck = GetPlayerVehicleID(playerid);
if(CarCheck == DSchool[0] || DSchool[1] || CarCheck == DSchool[2] || CarCheck == DSchool[3] || CarCheck == DSchool[4] || CarCheck == DSchool[5] || CarCheck == DSchool[6] || CarCheck == DSchool[7])
{
if(DriversTest[playerid] == 1)
{
DisablePlayerCheckpoint(playerid);
SendClientMessage(playerid, COLOR_RED, "<!>You have left your vehicle and failed drivers test!");
DriversTest[playerid] = 0;
return 1;
}
}
return 1;
}

