- 0
Mic ajutor aici.
-
Similar Content
-
Recently Browsing 0 members
- No registered users viewing this page.
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.
Question
nfs32100
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.
2 answers to this question
Recommended Posts