28.03.2018, 14:46
Change these codes
into
i added check on the code, so it won't send you a driving test message if you're not in a motor vehicles.
Код:
if(newstate == PLAYER_STATE_DRIVER)
{
for(new p; p < sizeof(DrivingCars); p++)
{
new vehid=GetPlayerVehicleID(playerid);
if(vehid == p)
{
if(pInfo[playerid][ptempdrivinglicence] != 1)
{
SendClientMessage(playerid, -1,"{c45461}first you need to start the driving test, you can start it in the driving school.");
return RemovePlayerFromVehicle(playerid);
}
}
}
}
Код:
if(newstate == PLAYER_STATE_DRIVER)
{
// get vehicle id
new vehid = GetPlayerVehicleID(playerid);
// check if vehicle doesn't have engine
if(WithoutMotor(vehid))
{
for(new p; p < sizeof(DrivingCars); p++)
{
if(vehid == p)
{
if(pInfo[playerid][ptempdrivinglicence] != 1)
{
SendClientMessage(playerid, -1,"{c45461}first you need to start the driving test, you can start it in the driving school.");
return RemovePlayerFromVehicle(playerid);
}
// break the loop
break;
}
}
}
}

