29.01.2013, 17:02
Try this:
pawn Код:
if(CCP[playerid] == 1)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(IsATestCar(vehicleid))
{
new Float:health;
GetVehicleHealth(vehicleid, health);
if(health < 900.0)
{
SendClientMessage(playerid, COLOR_LIGHTBLUE,"Driver Instructor says: The car is to damaged!");
SendClientMessage(playerid, COLOR_LIGHTBLUE,"Driver Instructor says: You didn't passed the test, please try again!");
DisablePlayerCheckpoint(playerid);
RemovePlayerFromVehicle(playerid);
SetVehicleToRespawn(vehicleid);
PlayerInfo[playerid][pTakingLesson] = 0;
return 0;
}
DisablePlayerCheckpoint(playerid);
CCP[playerid] = 2;
SetPlayerCheckpoint(playerid, 1429.81,-1732.20,13.38, 10.0);
}
else
{
SendClientMessage(playerid, COLOR_LIGHTBLUE,"Driver Instructor says: You are not in a car!");
SendClientMessage(playerid, COLOR_LIGHTBLUE,"Driver Instructor says: You didn't pass the test, please try again!");
DisablePlayerCheckpoint(playerid);
RemovePlayerFromVehicle(playerid);
SetVehicleToRespawn(vehicleid);
PlayerInfo[playerid][pTakingLesson] = 0;
return 0;
}
return 1;
}
if(CCP[playerid] == 2)
{
DisablePlayerCheckpoint(playerid);
CCP[playerid] = 3;
SetPlayerCheckpoint(playerid, 1820.42,-1732.44,13.38, 10.0);
return 1;
}