14.07.2012, 13:56
Quote:
So i just need to add
pawn Код:
|
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
new carid = GetPlayerVehicleID(playerid);
if(IsADMVCar(carid))
{
if(TakingDrivingTest[playerid] == 1)
{
if(PlayerToPoint(5.0,playerid,2068.7415,-1913.5304,13.3192) && DrivingTestStep[playerid] == 1)
{
DrivingTestStep[playerid] = 2;
SetPlayerCheckpoint(playerid, 2068.7415,-1913.5304,13.3192, 5.0);
}
else if(PlayerToPoint(5.0,playerid,2084.2441,-1879.5679,13.0991) && DrivingTestStep[playerid] == 2)
{
DrivingTestStep[playerid] = 3;
SetPlayerCheckpoint(playerid, 2087.5696,-1778.1520,13.1532, 5.0);
}
else if(PlayerToPoint(5.0,playerid,2087.5696,-1778.1520,13.1532) && DrivingTestStep[playerid] == 3)
{
DrivingTestStep[playerid] = 4;
SetPlayerCheckpoint(playerid, 2032.9459,-1749.4602,13.1555, 5.0);
}
else if(PlayerToPoint(5.0,playerid,2032.9459,-1749.4602,13.1555) && DrivingTestStep[playerid] == 4)
{
DrivingTestStep[playerid] = 5;
SetPlayerCheckpoint(playerid, 1922.5228,-1749.9053,13.1541, 5.0);
}
else if(PlayerToPoint(5.0,playerid,1922.5228,-1749.9053,13.1541) && DrivingTestStep[playerid] == 5)
{
DrivingTestStep[playerid] = 6;
SetPlayerCheckpoint(playerid, 1824.5392,-1727.6184,13.1554, 5.0);
}
else if(PlayerToPoint(5.0,playerid,1824.5392,-1727.6184,13.1554) && DrivingTestStep[playerid] == 6)
{
DrivingTestStep[playerid] = 7;
SetPlayerCheckpoint(playerid, 1784.2493,-1606.8083,13.1385, 5.0);
}
else if(PlayerToPoint(5.0,playerid,1784.2493,-1606.8083,13.1385) && DrivingTestStep[playerid] == 7)
{
DrivingTestStep[playerid] = 8;
SetPlayerCheckpoint(playerid, 1684.3798,-1590.0769,13.1560, 5.0);
}
else if(PlayerToPoint(5.0,playerid,1684.3798,-1590.0769,13.1560) && DrivingTestStep[playerid] == 8)
{
DrivingTestStep[playerid] = 9;
SetPlayerCheckpoint(playerid, 1570.4451,-1589.5077,13.1541, 5.0);
}
else if(PlayerToPoint(5.0,playerid,1570.4451,-1589.5077,13.1541) && DrivingTestStep[playerid] == 9)
{
DrivingTestStep[playerid] = 10;
SetPlayerCheckpoint(playerid, 1527.8423,-1619.7291,13.1554, 5.0);
}
else if(PlayerToPoint(5.0,playerid,1527.8423,-1619.7291,13.1554) && DrivingTestStep[playerid] == 10)
{
DrivingTestStep[playerid] = 11;
SetPlayerCheckpoint(playerid, 1527.2231,-1705.9948,13.1554, 5.0);
}
else if(PlayerToPoint(5.0,playerid,1527.2231,-1705.9948,13.1554) && DrivingTestStep[playerid] == 11)
{
DrivingTestStep[playerid] = 12;
SetPlayerCheckpoint(playerid, 1494.3622,-1729.9639,13.1554, 5.0);
}
else if(PlayerToPoint(5.0,playerid,1494.3622,-1729.9639,13.1554) && DrivingTestStep[playerid] == 12)
{
DrivingTestStep[playerid] = 13;
SetPlayerCheckpoint(playerid, 1417.2826,-1729.6477,13.1633, 5.0);
}
else if(PlayerToPoint(5.0,playerid,1417.2826,-1729.6477,13.1633) && DrivingTestStep[playerid] == 13)
{
DrivingTestStep[playerid] = 14;
SetPlayerCheckpoint(playerid, 1386.8727,-1840.9457,13.1541, 5.0);
}
else if(PlayerToPoint(5.0,playerid,1386.8727,-1840.9457,13.1541) && DrivingTestStep[playerid] == 14)
{
DrivingTestStep[playerid] = 15;
SetPlayerCheckpoint(playerid, 1463.2797,-1875.0575,13.1547, 5.0);
}
else if(PlayerToPoint(5.0,playerid,1463.2797,-1875.0575,13.1547) && DrivingTestStep[playerid] == 15)
{
DrivingTestStep[playerid] = 16;
SetPlayerCheckpoint(playerid, 1637.7559,-1875.4866,13.1541, 5.0);
}
else if(PlayerToPoint(5.0,playerid,1637.7559,-1875.4866,13.1541) && DrivingTestStep[playerid] == 16)
{
DrivingTestStep[playerid] = 17;
SetPlayerCheckpoint(playerid, 1692.3719,-1838.1967,13.1555, 5.0);
}
else if(PlayerToPoint(5.0,playerid,1692.3719,-1838.1967,13.1555) && DrivingTestStep[playerid] == 17)
{
DrivingTestStep[playerid] = 18;
SetPlayerCheckpoint(playerid, 1731.2744,-1818.6259,13.1376, 5.0);
}
else if(PlayerToPoint(5.0,playerid,1731.2744,-1818.6259,13.1376) && DrivingTestStep[playerid] == 18)
{
DrivingTestStep[playerid] = 19;
SetPlayerCheckpoint(playerid, 1798.4176,-1834.8743,13.1604, 5.0);
}
else if(PlayerToPoint(5.0,playerid,1798.4176,-1834.8743,13.1604) && DrivingTestStep[playerid] == 19)
{
DrivingTestStep[playerid] = 20;
SetPlayerCheckpoint(playerid, 1819.6390,-1872.5280,13.1837, 5.0);
}
else if(PlayerToPoint(5.0,playerid,1819.6390,-1872.5280,13.1837) && DrivingTestStep[playerid] == 20)
{
DrivingTestStep[playerid] = 21;
SetPlayerCheckpoint(playerid, 1936.6617,-1934.8263,13.1541, 5.0);
}
else if(PlayerToPoint(5.0,playerid,1936.6617,-1934.8263,13.1541) && DrivingTestStep[playerid] == 21)
{
DrivingTestStep[playerid] = 22;
SetPlayerCheckpoint(playerid, 2056.2322,-1912.3051,13.3194, 5.0);
}
else if(PlayerToPoint(5.0,playerid,2056.2322,-1912.3051,13.3194) && DrivingTestStep[playerid] == 22)
{
new Float:health;
veh = GetPlayerVehicleID(playerid);
GetVehicleHealth(veh, health);
if(health >= 950.0)
{
new Float:x, Float:y, Float:z,Float:distance = 3.0;
GetPlayerPos(playerid,x,y,z);
if(IsPlayerInRangeOfPoint(playerid,3.0,x,y,z))
PlayAudioStreamForPlayer(playerid,"http://www.fileden.com/files/2012/4/18/3293679/Gta%20San%20Andreas%20Mission%20Complete%20Sound%20HQ.mp3",x,y,z,distance,0);
GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
if(engine == VEHICLE_PARAMS_ON) { SetVehicleParamsEx(veh,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective); }
SendClientMessage(playerid, COLOR_GREEN, "Congratulations! You have passed the drivers license test!");
//GameTextForPlayer(playerid, "~g~Passed", 3000, 1);
GameDrawForPlayer(playerid,"~g~Passed", 2000);
PlayerInfo[playerid][pCarLic] = 1;
EngineStatus[veh] = 0;
SetVehicleToRespawn(veh);
EngineStatus[veh] = 0;
TakingDrivingTest[playerid] = 0;
DisablePlayerCheckpoint(playerid);
ActiveCP[playerid] = 0;
GivePlayerCash(playerid,-Businesses[12][EntranceCost]);
Businesses[12][Till] += Businesses[12][EntranceCost];
}
else
{
GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
if(engine == VEHICLE_PARAMS_ON) { SetVehicleParamsEx(veh,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective); }
SendClientMessage(playerid, COLOR_LIGHTRED, "Bad Luck! You have failed the drivers license test, please try again.");
SendClientMessage(playerid, COLOR_LIGHTRED, "You have been charged $50 for the attempting and failing your test.");
//GameTextForPlayer(playerid, "~r~Failed", 3000, 1);
GameDrawForPlayer(playerid,"~r~Failed", 2000);
EngineStatus[veh] = 0;
SetVehicleToRespawn(veh);
EngineStatus[veh] = 0;
TakingDrivingTest[playerid] = 0;
DisablePlayerCheckpoint(playerid);
ActiveCP[playerid] = 0;
GivePlayerCash(playerid,-50);
Businesses[12][Till] += 50;
}
DrivingTestStep[playerid] = 0;
ActiveCP[playerid] = 0;
}
}
return 1;
}