20.02.2016, 01:57
(
Последний раз редактировалось Dokins; 20.02.2016 в 02:43.
)
pawn Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
if(checkpointid == DrivingCheck[playerid][0])
{
DestroyDynamicCP(DrivingCheck[playerid][0]);
RemovePlayerMapIcon(playerid, 0);
SendClientMessage(playerid, COLOUR_ORANGE, "Please proceed ahead and REVERSE park in the highlighted bay (checkpoint). Mind your speed and obstacles.");
SendClientMessage(playerid, COLOUR_RED, "You must reverse park or the test will not continue, you must park parallel to the other vehicles");
DrivingCheck[playerid][1] = CreateDynamicCP(-2065.4126,-164.0089,35.2117, 2, GetPlayerVirtualWorld(playerid), 0, playerid, 100.0);
SetPlayerMapIcon(playerid, 0, -2065.4126,-164.0089,35.2117, 0, COLOUR_RED, MAPICON_LOCAL);
}
if(checkpointid == DrivingCheck[playerid][1])
{
new vehicleid = GetPlayerVehicleID(playerid), Float: angle;
GetVehicleZAngle(vehicleid, angle);
new newangle = floatround(angle);
if(newangle == 267 ||newangle == 268 || newangle == 269 || newangle == 270 || newangle == 271 || newangle == 272 || newangle == 273 || newangle == 274)
{
DestroyDynamicCP(DrivingCheck[playerid][2]);
RemovePlayerMapIcon(playerid, 0);
SendClientMessage(playerid, COLOUR_ORANGE, "Well Done! You completed the reverse bay park!");
SendClientMessage(playerid, COLOUR_ORANGE, "Please proceed ahead to the next checkpoint at the car park exit. Mind your speed and obstacles.");
DrivingCheck[playerid][2] = CreateDynamicCP(-2035.7332,-167.8290,35.1569, 2, GetPlayerVirtualWorld(playerid), 0, playerid, 100.0);
SetPlayerMapIcon(playerid, 0, -2035.7332,-167.8290,35.1569, 0, COLOUR_RED, MAPICON_LOCAL);
}
else
{
SendClientMessage(playerid, COLOUR_RED, "Please attempt the reverse park again (exit and enter the checkpoint at correct angle).");
}
}
if(checkpointid == DrivingCheck[playerid][2])
{
DestroyDynamicCP(DrivingCheck[playerid][2]);
RemovePlayerMapIcon(playerid, 0);
SendClientMessage(playerid, COLOUR_ORANGE, "Independent Driving Module.");
SendClientMessage(playerid, COLOUR_ORANGE, "Please proceed ahead to the next checkpoint at the end of the street. Mind your speed and obstacles.");
SendClientMessage(playerid, COLOUR_RED, "Be very aware of obstacles on the road, damage to the vehicle may cause you to fail your test.");
DrivingCheck[playerid][3] = CreateDynamicCP(-2050.1340,-260.8407,35.0739, 2, GetPlayerVirtualWorld(playerid), 0, playerid, 100.0);
SetPlayerMapIcon(playerid, 0, -2050.1340,-260.8407,35.0739, 0, COLOUR_RED, MAPICON_LOCAL);
}
if(checkpointid == DrivingCheck[playerid][3])
{
DestroyDynamicCP(DrivingCheck[playerid][3]);
RemovePlayerMapIcon(playerid, 0);
SendClientMessage(playerid, COLOUR_ORANGE, "Urban area driving and parking.");
SendClientMessage(playerid, COLOUR_ORANGE, "Please proceed ahead to the next checkpoint at the end of the street on the right and park your vehicle.");
SendClientMessage(playerid, COLOUR_RED, "You do not have to park the vehicle at any certain angle, just as long as you enter the bay (Checkpoint) and turn around.");
SendClientMessage(playerid, COLOUR_RED, "Be extremely aware of obstacles on the road, damage to the vehicle may cause you to fail your test.");
DrivingCheck[playerid][4] = CreateDynamicCP(-2044.6074,-205.7463,35.0555, 2, GetPlayerVirtualWorld(playerid), 0, playerid, 100.0);
SetPlayerMapIcon(playerid, 0, -2044.6074,-205.7463,35.0555, 0, COLOUR_RED, MAPICON_LOCAL);
}
if(checkpointid == DrivingCheck[playerid][4])
{
DestroyDynamicCP(DrivingCheck[playerid][4]);
RemovePlayerMapIcon(playerid, 0);
SendClientMessage(playerid, COLOUR_ORANGE, "For the final part of you test, continue out of the garage following the road to the two trucks on the side of the street.");
SendClientMessage(playerid, COLOUR_RED, "Please park the vehicle between the two trucks, you must park at a reasonable angle so as to not block traffic.");
SendClientMessage(playerid, COLOUR_RED, "Be extremely aware of obstacles on the road, damage to the vehicle may cause you to fail your test.");
DrivingCheck[playerid][5] = CreateDynamicCP(-2027.6936,-233.1335,35.1566, 2, GetPlayerVirtualWorld(playerid), 0, playerid, 100.0);
SetPlayerMapIcon(playerid, 0, -2027.6936,-233.1335,35.1566, 0, COLOUR_RED, MAPICON_LOCAL);
}
if(checkpointid == DrivingCheck[playerid][5])
{
new vehicleid = GetPlayerVehicleID(playerid), Float: angle;
GetVehicleZAngle(vehicleid, angle);
new newangle = floatround(angle);
if(newangle == 356 ||newangle == 357 || newangle == 358 || newangle == 359 || newangle == 360 || newangle == 361 || newangle == 362)
{
DestroyDynamicCP(DrivingCheck[playerid][5]);
RemovePlayerMapIcon(playerid, 0);
SendClientMessage(playerid, COLOUR_ORANGE, "Well Done! You completed the parallel park!");
SendClientMessage(playerid, COLOUR_ORANGE, "To complete your test, please proceed to the last checkpoint on your map to receieve your results. Mind your speed and obstacles.");
DrivingCheck[playerid][6 = CreateDynamicCP(-2024.5856,-126.0978,35.1566, 2, GetPlayerVirtualWorld(playerid), 0, playerid, 100.0);
SetPlayerMapIcon(playerid, 0, -2024.5856,-126.0978,35.1566, 0, COLOUR_RED, MAPICON_LOCAL);
}
else
{
SendClientMessage(playerid, COLOUR_RED, "Please attempt the parallel park again (exit and enter the checkpoint at correct angle).");
}
}
if(checkpointid == DrivingCheck[playerid][6])
{
new string[128], reason[64], Float: health;
DestroyDynamicCP(DrivingCheck[playerid][6]);
RemovePlayerMapIcon(playerid, 0);
RemovePlayerFromVehicle(playerid);
SetPlayerPos(playerid, -2033.55774, -117.38980, 1034.62805);
SetPlayerVirtualWorld(playerid, 0);
SetPlayerInterior(playerid, 3);
TakingTest[playerid] = 0;
if(GetVehicleHealth(testcar[playerid], health) < 950)
{
TestFailed[playerid] = 1;
format(reason, sizeof(reason), "Test vehicle damaged significantly.");
}
if(TestSpeed[playerid] > 30)
{
TestFailed[playerid] = 1;
format(reason, sizeof(reason), "Excessive speed: %d MPH - LIMIT 30 MPH.", TestSpeed[playerid]);
TestSpeed[playerid] = 0;
}
if(TestTimeTaken[playerid] > 360000)
{
TestFailed[playerid] = 1;
format(reason, sizeof(reason), "Exceeded reasonable time of completion - LIMIT: 6 minutes - Your Time: %d minutes", TestTimeTaken[playerid]);
TestTimeTaken[playerid] = 0;
}
switch(TestFailed[playerid])
{
case 0:
{
SendClientMessage(playerid, COLOUR_GREEN, "_________Driving Test Results_________");
format(string, sizeof(string), "Driving Test "COL_GREEN"PASSED.");
SendClientMessage(playerid, COLOUR_WHITE, string);
SendClientMessage(playerid, COLOUR_ORANGE, "Congratulations! You are now the holder of a driving license, good luck!");
SendClientMessage(playerid, COLOUR_GREEN, "________________________________________");
GameTextForPlayer(playerid, "~g~DRIVING TEST PASSED", 3000, 1);
}
case 1:
{
SendClientMessage(playerid, COLOUR_GREEN, "_________Driving Test Results_________");
format(string, sizeof(string), "Driving Test "COL_RED"FAILED.");
SendClientMessage(playerid, COLOUR_WHITE, string);
format(string, sizeof(string), "Reason for failure: "COL_RED"%s", reason);
SendClientMessage(playerid, COLOUR_WHITE, string);
SendClientMessage(playerid, COLOUR_WHITE, "Please consider your reason for failing and try again when you are prepared.");
SendClientMessage(playerid, COLOUR_GREEN, "________________________________________");
GameTextForPlayer(playerid, "~r~DRIVING TEST FAILED", 3000, 1);
}
}
}
It seems to be skipping most of the checkpoints!"
Any assistance would be kind.