Order a list
#4

Quote:
Originally Posted by Marricio
Посмотреть сообщение
That's going to show the same number twice. Preferably:

PHP код:
new count;
for(new 
i10++)
{
    if(
pItems[playerid][iID][i] > && pItems[playerid][iUsed][i] == 0)
    {
        
count ++;
        
format(stringsizeof(string), "%s[%i]\t%s\t[%i]\n"stringcountNObject(pItems[playerid][iType][i]), pItems[playerid][iAmmo][i]);
    }
}
if(
count 10)
{
    for(new 
i10-counti++)
    {
        
count++;
        
format(stringsizeof(string), "%s[%i]\tEmpty space\n"stringcount);
    }

Thanks, but there's a problem.

When the player has no items, show 10 slots. When the player has 1 item it shows 9 slots (1 occuped 8 empty), if 2, shows 8 slots, etc.

// EDIT

Worked, using:
Код:
.......
if(count < 10)
{
    new rest; 
    rest = 10-count;
    for(new i; i < rest; i++) 
    {
...
Thanks!!!
Reply


Messages In This Thread
Order a list - by HidroDF - 15.10.2016, 17:25
Re: Order a list - by SickAttack - 15.10.2016, 17:35
Respuesta: Re: Order a list - by Marricio - 15.10.2016, 17:40
Respuesta: Re: Order a list - by HidroDF - 15.10.2016, 18:12
Respuesta: Re: Order a list - by Marricio - 15.10.2016, 18:26
Respuesta: Order a list - by HidroDF - 15.10.2016, 18:29

Forum Jump:


Users browsing this thread: 1 Guest(s)