24.03.2016, 23:51
pawn Code:
new indexes[5], count;
static const item_names[][] =
{
{"chair"},
{"box"},
{"tv"},
{"couch"},
{"bed"}
};
for(new i = 0, j = sizeof(item_names); i < j; i ++)
{
if(!GetItemValue(playerid, item_names[i][0]))
{
continue;
}
indexes[count] = i;
count ++;
}
GiveItem(playerid, item_names[indexes[random(count)]][0]);