Jump to content

Recommended Posts

Posted

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.

Posted
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.

Posted (edited)

foloseste CP[playerid] ++;

Edit : Iti recoamnd sa folosesti OnPlayerEnterRaceCheckpoint!

Edited by DanielSy

 

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.