30.07.2018, 08:24
Quote:
Код:
RandomHospitalLoot() { const items[] = { ITEM_MEDKIT, ITEM_BONDAGE, ITEM_FIRSTAID }; return items[random(sizeof (items))]; } |
Items[] = { ITEM_MEDKIT, ITEM_BONDAGE, ITEM_FIRSTAID } ; // ID: Array starts on 0 so 0,1,2
items[random(sizeof(items))]; sizeof getting the total value in items array and then it it random from 0-2 if im not mistaken and then if it random to 1 then ITEM_BONDAGE will return of its ID right?
^ enlighten me please