CMD:exam(playerid, params[])
{
// Basically it is working fine and it enables the variable LicenseTest and CP2 so I can enter the DMV car and stuff ...
GivePlayerCash(playerid, -10000);
LicenseTest[playerid] =1;
CP2[playerid] = 1;
SendClientMessage(playerid,COLOR_LIGHTBLUE,"* Drivers Center: Get into a car outside to begin the test.");
return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(!ispassenger)
{
if(IsDMVCar(vehicleid))
{
if(!LicenseTest[playerid])
{
new Float:pos[3];
GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
SendClientMessage(playerid, COLOR_ORANGE, "You are not taking a drivers license test.");
}
else
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* GPS: Finish the test by driving through all of the checkpoints on your GPS.");
SetPlayerCheckpoint(playerid,2040.7101,-1930.1340,13.4667,5);
SendClientMessage(playerid, COLOR_RED, "If you exit the car your test will be failed and it will have to be re-done.");
}
}
// ..............
if(CP[playerid] == 1) // Drivers License Test
{
if(IsPlayerInRangeOfPoint(playerid,5,2040.7101,-1930.1340,13.4667)) // Checkpoint 1
{
SetPlayerCheckpoint(playerid,1948.1033,-1930.6860,13.4751,5);
}
else if(IsPlayerInRangeOfPoint(playerid,5,1948.1033,-1930.6860,13.4751)) // Checkpoint 2
{
SetPlayerCheckpoint(playerid,1830.9167,-1930.0353,13.4754,5);
}
else if(IsPlayerInRangeOfPoint(playerid,5,1830.9167,-1930.0353,13.4754)) // Checkpoint 3
{
SetPlayerCheckpoint(playerid,1823.9110,-1791.2739,13.4752,5);
}
else if(IsPlayerInRangeOfPoint(playerid,5,1823.9110,-1791.2739,13.4752)) // Checkpoint 4
{
SetPlayerCheckpoint(playerid,1824.1433,-1629.3223,13.4751,5);
}
else if(IsPlayerInRangeOfPoint(playerid,5,1824.1433,-1629.3223,13.4751)) // Checkpoint 5
{
SetPlayerCheckpoint(playerid,1929.6962,-1614.7090,13.4751,5);
}
else if(IsPlayerInRangeOfPoint(playerid,5,1929.6962,-1614.7090,13.4751)) // Checkpoint 6
{
SetPlayerCheckpoint(playerid,1938.9127,-1738.9067,13.4751,5);
}
else if(IsPlayerInRangeOfPoint(playerid,5,1938.9127,-1738.9067,13.4751)) // Checkpoint 7
{
SetPlayerCheckpoint(playerid,1959.0842,-1765.3502,13.4750,5);
}
else if(IsPlayerInRangeOfPoint(playerid,5,1959.0842,-1765.3502,13.4750)) // Checkpoint 8
{
SetPlayerCheckpoint(playerid,1975.3130,-1814.8724,13.4751,5);
}
else if(IsPlayerInRangeOfPoint(playerid,5,1975.3130,-1814.8724,13.4751)) // Checkpoint 9
{
SetPlayerCheckpoint(playerid,2066.9341,-1814.9067,13.4751,5);
}
else if(IsPlayerInRangeOfPoint(playerid,5,2066.9341,-1814.9067,13.4751 )) // Checkpoint 10
{
SetPlayerCheckpoint(playerid,2078.9148,-1897.3009,13.4473,5);
}
else if(IsPlayerInRangeOfPoint(playerid,5,2078.9148,-1897.3009,13.4473)) // Checkpoint 11
{
SetPlayerCheckpoint(playerid,2074.2095,-1907.4380,13.6393,5);
}
else if(IsPlayerInRangeOfPoint(playerid,5,2074.2095,-1907.4380,13.6393)) // Checkpoint 12
{
new Float:Health;
GetVehicleHealth(GetPlayerVehicleID(playerid), Health);
if(Health > 900)
{
DisablePlayerCheckpoint(playerid);
PlayerInfo[playerid][pCarLic] = 1;
LicenseTest[playerid] = 0;
CP[playerid] = 0;
SetVehicleToRespawn(GetPlayerVehicleID(playerid));
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Driving Center: You have successfully passed the test and received your license.");
}
else
{
DisablePlayerCheckpoint(playerid);
LicenseTest[playerid] = 0;
CP[playerid] = 0;
SetVehicleToRespawn(GetPlayerVehicleID(playerid));
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Driving Center: You have damaged your vehicle hardly, therefore you failed the test.");
}
}
}
else DisablePlayerCheckpoint(playerid);
new OnExam[MAX_PLAYERS]; COMMAND:exam(playerid, params[]) { OnExam[playerid] = 1; } OnPlayerEnterCheckpoint { If(OnExam[playerid] == 1) { SetPlayerCheckpoint OnExam[playerid] = 2; } else if (OnExam[playerid] == 2) { SetCP OnExam[playerid] = 3; }
public OnPlayerEnterCheckpoint(playerid)
{
switch(DMVExam[playerid])
{
case 1: // DMV SYSTEM CHECKPOINT 1 ( it was set when the player enter the DMV car )
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,1948.1033,-1930.6860,13.4751,5); // 2
DMVExam[playerid] = 2;
}
case 2:
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,1830.9167,-1930.0353,13.4754,5); // 3
DMVExam[playerid] = 3;
}
case 3:
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,1823.9110,-1791.2739,13.4752,5); // 4
DMVExam[playerid] = 4;
}
case 4:
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,1824.1433,-1629.3223,13.4751,5); // 5
DMVExam[playerid] = 5;
}
case 5:
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,1929.6962,-1614.7090,13.4751,5); // 6
DMVExam[playerid] = 6;
}
case 6:
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,1938.9127,-1738.9067,13.4751,5); // 7
DMVExam[playerid] = 7;
}
case 7:
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,1959.0842,-1765.3502,13.4750,5); // 8
DMVExam[playerid] = 8;
}
case 8:
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,1975.3130,-1814.8724,13.4751,5); // 9
DMVExam[playerid] = 9;
}
case 9:
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,2066.9341,-1814.9067,13.4751,5); // 10
DMVExam[playerid] = 10;
}
case 10:
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,2078.9148,-1897.3009,13.4473,5); // 11
DMVExam[playerid] = 11;
}
case 11:
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,2074.2095,-1907.4380,13.6393,5); // 12
DMVExam[playerid] = 12;
}
case 12:
{
new Float:Health;
GetVehicleHealth(GetPlayerVehicleID(playerid), Health);
if(Health > 950)
{
DisablePlayerCheckpoint(playerid);
PlayerInfo[playerid][pCarLic] = 1;
LicenseTest[playerid] = 0;
CP2[playerid] = 0;
DMVExam[playerid] = 0;
SetVehicleToRespawn(GetPlayerVehicleID(playerid));
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Driving Center: You have successfully passed the test and received your license.");
}
else
{
DisablePlayerCheckpoint(playerid);
LicenseTest[playerid] = 0;
CP2[playerid] = 0;
DMVExam[playerid] = 0;
SetVehicleToRespawn(GetPlayerVehicleID(playerid));
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Driving Center: You have damaged your vehicle hardly, therefore you failed the test.");
}
}
new DMVExam[MAX_PLAYERS];
public OnPlayerEnterCheckpoint(playerid)
{
switch(DMVExam[playerid])
{
case 1: // DMV SYSTEM CHECKPOINT 1 ( it was set when the player enter the DMV car )
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,1948.1033,-1930.6860,13.4751,5); // 2
DMVExam[playerid] = 2;
}
case 2:
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,1830.9167,-1930.0353,13.4754,5); // 3
DMVExam[playerid] = 3;
}
case 3:
{
DisablePlayerCheckpoint(playerid);
}
}
return 1;
}
CMD:test(playerid, params[])
{
SetPlayerCheckpoint(playerid,2078.9148,-1897.3009,13.4473,5);
DMVExam[playerid]++;
return 1;