Jump to content

Checkpointuri(2)


Rimmon

Recommended Posts

In primul toturial cu checkpointuri vam prezentat ce functii se folosesc pentru creearea unui checkpoint

In acest toturial va voi prezenta cum faci o reactie in lant ca sa ii zic asa a checkpointurilor

Dupa acest toturial daca il intelegeti va puteti face joburi/DMV system etc

Ok hai ca incepem

Mai intai trebuie sa creem o variabila noua

eu o voi numi CP

[pawn]new CP[MAX_PLAYERS];[/pawn]

Aceasta variabila ne ajuta la creearea checkpointurilor

Intro comanda sau spawn sau orice vreti voi va trebui sa creem un checkpoint

Eu o voi face printr-o comanda folosinduma de ZCMD

[pawn]CMD:checkpoint(playerid,params[])

{

    SetPlayerCheckpoint(playerid,5363.3623,6425.3263,6546.1245,5);

    CP[playerid] = 1;

    return 1;

}[/pawn]

Sa nu copiati coordonatele pe care leam folosit eu(acele coordonate leam pus eu asa din capu meu)

Acum la OnPlayerEnterCheckpoint

[pawn]public OnPlayerEnterCheckpoint(playerid)

{

    if(CP[playerid] == 1)

    {

          DisablePlayerCheckpoint(playerid);

          SetPlayerCheckpoint(playerid,8755.4351,5322.3424,4553.4325,6);

          CP[playerid] = 2;

    }

    else if(CP[playerid] == 2)

    {

          //Celalalt Checkpoint(faceti exact la primul ) doar ca puneti coordonatele celui de-al 2-lea checkpoint

    }

    return 1;

}[/pawn]

Daca nu puneti la fiecare checkpoint(cand vreti sa faceti o cursa ) DisablePlayerCheckpoint o sa primiti eroare in joc..adica nu va aparea cel de al 2-3-4 etc checkpoint

CP lam folosit pentru a "afla" sa zic asa numarul checkpointului

Adica daca primul checkpoint pe care lai creat ii dai CP[playerid] = 2

Checkpointul va avea numarul 2 si il vei folosi asa

if(CP[playerid] == 2)

{

}

Depinde de numarul folosit

Cam asa se creeaza o cursa sau o reactie in lant cum ii spun eu a checkpointurilor :D:D bafta ..daca aveti probleme/nemultumiri sau am scris ceva gresit dati un reply

Massari e curva mea

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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.