24.03.2013, 22:27
so i looped your DSchool vehicles its much easier and save you a space
Try This Code
Try This Code
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
new CarCheck = GetPlayerVehicleID(playerid);
for(new i = 0; i < sizeof(DSchool); i++)//loop for all DSchool
{
if(CarCheck == DSchool[i])
{
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;
}
}
}
}
return 1;
}
