Jump to content
  • 0

Mic ajutor aici.


nfs32100

Question

Salut,am si eu o problema.Am un sistem de inventar, si vreau sa-mi caute in inventar trei obiecte de acelasi fel.

Sistemul asa cauta un loc gol

[pawn]stock FindPlayerBagSpace(playerid)

{

    for(new s; s < BAGCOUNT; s++)

    {

        if (Bags[playerid] == EMPTY_BAGSPACE) return s;

    }

    return EMPTY_BAGSPACE;

}[/pawn]

Iar eu am incercat

[pawn]

stock GasesteBronze(playerid)

{

    for(new s; s < BAGCOUNT; s++)

    {

        if (Bags[playerid] == bronze)

        {

        if (Bags[playerid][s++] == bronze)

        {

        if (Bags[playerid][s++] == bronze) return s;

        }

        }

    }

    return bronze;

}

[/pawn]

Dar imi cauta decat 2 iteme de acelasi fel.Cum as pute sa-mi caute 3 iteme?Sau macar imi ziceti cum fac sa caut numai de doua ori.

Iar apoi mai este comanda:

[pawn] new space = FindPlayerBagSpace(playerid);

        if (space == EMPTY_BAGSPACE) return SendClientMessage(playerid, YELLOW, "[ ! ] Valiza ta este plina!");

        Bags[playerid][space] = prezervativ;[/pawn]

Multumesc pentru ajutor.

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

stock GasesteBronze(playerid)

{

    for(new s; s < BAGCOUNT; s++)

    {

        if (Bags[playerid] == bronze)

        {

        if (Bags[playerid][s+1] == bronze)

        {

        if (Bags[playerid][s+2] == bronze)

        }

        }

    }

    return bronze;

}

 

1859311972_BANNER-GIREADAcopy-min.thumb.png.48e5e420ae2185dce5b244965a1d2601.png

 

Link to comment
Share on other sites

Nu merge,imi da erori am incercat [pawn]stock GasesteBronze1(playerid)

{

    for(new s; s < BAGCOUNT; s++)

    {

        if (Bags[playerid] == bronze)

        {

        if (Bags[playerid][s+1] == bronze)

        {

        if (Bags[playerid][s+2] == bronze)

        {

        return s;

        }

        }

        }

    }

    return bronze;

}[/pawn]

Da eu vreau sa-mi caute in tot inventarul nu unu dupa altu

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.