Jump to content
  • 0

Problema checkpoint


PawnFox

Question

Deci vreau sa creez un checkpoint , si cand intru in acel checkpoint sa ma lase sa folosesc o comanda, care sa mearga numai cand sunt in acel checkpoint

Datimi o idee cum sa fac  :))

communitylogosml.png

94.23.120.101:7778

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

[pawn]SetPlayerCheckPoint(....);

CP[playerid] == 100;[/pawn]

Iar la

[pawn]public OnPlayerEnterCheckpoint(playerid)

{[/pawn]

[pawn]else if(CP[playerid]==100)

{

            // ce contine comanda

        }[/pawn]

eu unul asa as face :)

Link to comment
Share on other sites

[pawn]SetPlayerCheckPoint(....);

CP[playerid] == 100;[/pawn]

Iar la

[pawn]public OnPlayerEnterCheckpoint(playerid)

{[/pawn]

[pawn]else if(CP[playerid]==100)

{

            // ce contine comanda

        }[/pawn]

eu unul asa as face :)

Mersi mult , o sa incerc asa , o sa revin cu un edit :D

communitylogosml.png

94.23.120.101:7778

Link to comment
Share on other sites

Pai ma, faci cum a zis roberto

faci o variabila:

[pawn]new PtComanda[MAX_PLAYERS];[/pawn]

la onplayerconnect adaugi:

[pawn] PtComanda[playerid] = 0; // pt ca variabila sa fie 0 [/pawn]

faci comanda:

[pawn]if(strcmp(cmd, "/comanda", true) == 0)

{

    if(PtComanda[playerid] = 0)

    {

          //coordonatele comezi

    }

    //mesajul doar daca vrei

    else

    SendClientMessage(playerid, 0xFFFFFF, "Trebuie sa fi la checkpoint pentru a folosi comanda");

    return 1;

}[/pawn]

    apoi faci cum a zis roberto doar ca la:

[pawn]else if(CP[playerid]==100)

{

            //adaugi

          PtComanda[playerid] = 1; // asa o sa poate folosi comanda.

        }[/pawn]

PS: Sper ca e bine ce am zis, ca am uitat scripting:) !

 

Link to comment
Share on other sites

[pawn]SetPlayerCheckPoint(....);

CP[playerid] == 100;[/pawn]

Iar la

[pawn]public OnPlayerEnterCheckpoint(playerid)

{[/pawn]

[pawn]else if(CP[playerid]==100)

{

            // ce contine comanda

        }[/pawn]

eu unul asa as face :)

mai invata putin basic scripting si apoi vino sa faci snippets. cand nu e in nicio conditie nu se dubleaza egal-ul, moderatorule.

[pawn]

new bool:CanUseTheCommand[MAX_PLAYERS] = 0;

new bool:CheckPoint[MAX_PLAYERS];

public OnPlayerConnect(playerid)

{

CanUseTheCommand[playerid] = 0;

return 1;

}

public OnPlayerSpawn(playerid)

{

    CheckPoint[playerid] = 1;

    SetPlayerCheckpoint(playerid, x, y, z, size);

    return 1;

}

public OnPlayerEnterCheckpoint(playerid)

{

    if(CheckPoint[playerid])

    {

        CanUseTheCommand[playerid] = true;

    }

    return 1;

}

if(strcmp(cmd, "/comandata", true) == 0)

{

    if(CanUseTheCommand[playerid])

    {

        //orice aici

    }

    else

    {

        //mesaj daca nu poate folosi comanda

    }

    return 1;

}

[/pawn]

Link to comment
Share on other sites

Guest farse

[pawn]SetPlayerCheckpoint(playerid,X,Y,Z);

if(strcmp(cmd,"/comanda",100)==0)

{

if(IsPlayerInCheckpoint(playerid)&&IsPlayerInRangeOfPoint(playerid,3,X,Y,Z))

{

//seteaza,invarte,rastoarna

}else

{

//cand nu e in checkpoint..

}

return 1;

}[/pawn]

Link to comment
Share on other sites

merge cum a zis Farse numai ca eu nu am creat CP-ul cu SetPlayerCheckpoint , ci am creat cu CreateDynamicCheckpoint (plugin streamer) si dupa ce compilez primesc eroarea asta

C:\Documents and Settings\SA-MP\Desktop\SA-MP\filterscripts\new.pwn(64) : error 017: undefined symbol "checkpointid"
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


1 Error.

nu imi dau seama ce are

communitylogosml.png

94.23.120.101:7778

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • 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.