Quote:
Originally Posted by Marricio
That's going to show the same number twice. Preferably:
PHP код:
new count;
for(new i; i < 10; i ++)
{
if(pItems[playerid][iID][i] > 0 && pItems[playerid][iUsed][i] == 0)
{
count ++;
format(string, sizeof(string), "%s[%i]\t%s\t[%i]\n", string, count, NObject(pItems[playerid][iType][i]), pItems[playerid][iAmmo][i]);
}
}
if(count < 10)
{
for(new i; i < 10-count; i++)
{
count++;
format(string, sizeof(string), "%s[%i]\tEmpty space\n", string, count);
}
}
|
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!!!