Checkpoints - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Checkpoints (
/showthread.php?tid=645200)
Checkpoints -
Cubie - 22.11.2017
I've got an issue where the checkpoint does not align with the coordination at all.
The checkpoint is for some reason up in the sky. Thanks in advance.
PHP код:
CMD:licenseexam(playerid, params[])
{
if(!IsPlayerInDMVVehicle(playerid))
return SendErrorMessage(playerid, "You aren't in a license exam vehicle.");
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER)
return SendErrorMessage(playerid, "You aren't in the driver's seat.");
if(PlayerTakingLicense[playerid])
return SendErrorMessage(playerid, "You're already in middle of a test.");
new
vehicleid = GetPlayerVehicleID(playerid);
PlayerTakingLicense[playerid] = true;
PlayerLicenseTime[playerid] = 60;
PlayersLicenseVehicle[playerid] = vehicleid;
PlayerLicensePoint[playerid] = 0;
ToggleVehicleEngine(vehicleid, true);
VehicleInfo[vehicleid][eVehicleEngineStatus] = true;
SendClientMessage(playerid, COLOR_GREY, "License instructor says: Follow the checkpoints and the rules of the road.");
SetPlayerCheckpoint(playerid, LicensetestInfo[0][eCheckpointX], LicensetestInfo[1][eCheckpointY], LicensetestInfo[2][eCheckpointZ], 3.0);
return 1;
}
PHP код:
enum E_LICENSETEST_INFO
{
Float: eCheckpointX,
Float: eCheckpointY,
Float: eCheckpointZ,
bool: eFinishLine
}
new LicensetestInfo[][E_LICENSETEST_INFO] =
{
{-2464.205, 2300.62771, 2.59501, false},
{-2543.609, 2333.34301, 4.59201, false},
{1122.9329, -1572.2052, 13.4022, false},
{1046.1570, -1569.9575, 13.3828, false},
{1050.3602, -1506.8011, 13.3906, false},
{1065.1661, -1416.7653, 13.4577, false},
{1183.5283, -1405.4906, 13.2156, false},
{1261.6847, -1405.8959, 13.0086, false},
{1332.1536, -1405.6932, 13.3703, false},
{1324.8597, -1486.7848, 13.3828, false},
{1295.2579, -1561.2516, 13.3906, true}
};
Re: Checkpoints -
jop9888 - 22.11.2017
Use this:
SetPlayerCheckpoint(playerid, LicensetestInfo[0][eCheckpointX], LicensetestInfo[0][eCheckpointY], LicensetestInfo[0][eCheckpointZ], 3.0);
What your code does, is take X of array item 0, Y of array item 1 and Z of array item 2, that way coцrdinates got mixed up