18.11.2013, 21:23
I do not promise anything, and this might not work at all but try:
pawn Код:
stock GetNextSlot(playerid)
{
for(new i = 0; i < 10; i++)
{
if(i == 10) break;
if(!PlayerInfo[playerid][pSlot][i]) // is slot empty
{
return i; // return empty slot
}
}
return -1; // couldn't find an empty slot
}
// usage -> couldn't find
if(GetNextSlot(playerid) == -1) return SendClientMessage(playerid, COLOR_RED, "ERROR:{FFFFFF} Your inventory is full.");
// usage -> found an empty slot
if(GetNextSlot(playerid))
{
// do something here, ...
}