Jump to content

Nu imi apare urmatoru checkpoint


NoName145

Recommended Posts

if(PlayerToPoint(7.0, playerid, -372.6979, -1456.3641, 26.4046)) {
                if(PlayerInfo[playerid][pCarLic] == 0) return SCM(playerid, COLOR_LGREEN, "Eroare: Ai nevoie de o licenta de condus pentru a putea munci la acest job!");
                if(CP[playerid] != 0) return ShowPlayerDialog(playerid, DIALOG_CHECKPOINT, DIALOG_STYLE_MSGBOX, "Checkpoint", "Ai deja un checkpoint activ.\nDoresti sa-l anulezi? Daca da, apasa pe 'Ok'.", "Ok", "Exit");
                GetPlayerPos(playerid, x, y, z);
                TractorFarmer[playerid] = CreateVehicle(531, x, y, z, 100, 0, 0, 0);
                PutPlayerInVehicle(playerid, TractorFarmer[playerid], 0);
                SetPlayerCheckpoint(playerid, -377.7473, -1411.7401, 30.5690, 5.0);
                SCM(playerid, -1, "Foloseste-te de acest vehicul al fermei pentru a ara terenele agricole, mai apoi sa cultivezi graul.");
                CP[playerid] = 176;
            }  //aici i-am plasat primu checkpoint cand foloseste comanda /wrok

//OnPlayerEnterCheckpoint

        case 176: {
            SCM(playerid, COLOR_YELLOW, "Mergi prin toate cele 20 de checkpoint-uri pentru a ara terenele agricole.");
            SetPlayerCheckpoint(playerid, -419.0640, -1381.4750, 30.5690, 4.0);
            CP[playerid] = 177;
        }
        case 177: { 
            SetPlayerCheckpoint(playerid, -405.6464, -1382.1283, 27.8391, 4.0);
        } //Aici nu imi seteaza checkpoint-ul 177 cand intru in 176.

Link to comment
Share on other sites

new const gArrayCoordCheckpoint[][] = {
    { -372.6979, -1456.3641, 26.4046 }, // coord checkpoint 1
    { -419.0640, -1381.4750, 30.5690 } // coord checkpoint 2
    // ....
}
new gCheckpointCount[MAX_PLAYERS],
    gPlayerStart[MAX_PLAYERS char]; 

// when the player needs to show the first checkpoint 
SetPlayerCheckpoint(playerid,
    gArrayCoordCheckpoint[0][0],
    gArrayCoordCheckpoint[0][1],
    gArrayCoordCheckpoint[0][2], 3.0
);
gCheckpointCount[playerid] = 0;
gPlayerStart{playerid} = true;

// OnPlayerEnterCheckpoint
if( gPlayerStart{playerid} ) {
    gCheckpointCount[playerid] ++;
    if(gCheckpointCount[playerid] >= sizeof gArrayCoordCheckpoint) {
        
        // last checkpoint
        // ......

        gCheckpointCount[playerid] = 0;
        return true;
    }
    new idx = gCheckpointCount[playerid];
    SetPlayerCheckpoint(playerid,
        gArrayCoordCheckpoint[idx][0],
        gArrayCoordCheckpoint[idx][1],
        gArrayCoordCheckpoint[idx][2], 3.0
    );
}

this is current example.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.