Problems with OnPlayerStateChange Drivingschool
#4

Change these codes
Код:
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);
				}
			}
		}
	}
into
Код:
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;
            }
        }
    }
}
i added check on the code, so it won't send you a driving test message if you're not in a motor vehicles.
Reply


Messages In This Thread
Problems with OnPlayerStateChange Drivingschool - by BrightLeaN - 28.03.2018, 10:50
Re: Problems with OnPlayerStateChange Drivingschool - by AndreiWow - 28.03.2018, 12:25
Re: Problems with OnPlayerStateChange Drivingschool - by BrightLeaN - 28.03.2018, 12:36
Re: Problems with OnPlayerStateChange Drivingschool - by X337 - 28.03.2018, 14:46

Forum Jump:


Users browsing this thread: 1 Guest(s)