SA-MP Forums Archive
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(playeridparams[])
{
    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(vehicleidtrue); 
    
VehicleInfo[vehicleid][eVehicleEngineStatus] = true;
    
    
SendClientMessage(playeridCOLOR_GREY"License instructor says: Follow the checkpoints and the rules of the road.");
    
SetPlayerCheckpoint(playeridLicensetestInfo[0][eCheckpointX], LicensetestInfo[1][eCheckpointY], LicensetestInfo[2][eCheckpointZ], 3.0); 
    return 
1;

PHP код:
enum E_LICENSETEST_INFO
{
    
FloateCheckpointX,
    
FloateCheckpointY,
    
FloateCheckpointZ,
    
booleFinishLine
}
new 
LicensetestInfo[][E_LICENSETEST_INFO] = 
{
    {-
2464.2052300.627712.59501false},
    {-
2543.6092333.343014.59201false},
    {
1122.9329, -1572.205213.4022false},
    {
1046.1570, -1569.957513.3828false},
    {
1050.3602, -1506.801113.3906false},
    {
1065.1661, -1416.765313.4577false},
    {
1183.5283, -1405.490613.2156false},
    {
1261.6847, -1405.895913.0086false},
    {
1332.1536, -1405.693213.3703false},
    {
1324.8597, -1486.784813.3828false},
    {
1295.2579, -1561.251613.3906true}
}; 



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