Aller au contenu

Photo

question about random items


  • Veuillez vous connecter pour répondre
1 réponse à ce sujet

#1
Surek

Surek
  • Members
  • 94 messages

Just a quick question is it possable to take a random item from a PC?



#2
Shadooow

Shadooow
  • Members
  • 4 470 messages

Just a quick question is it possable to take a random item from a PC?

loop all items in inventory, increase integer variable counter by 1 for each found item

then get random inte from count and start loop over this time decrease the counter by 1 for each item found till the counter will be 0 in which case you break the loop and oItem will be random item.

 

Just be cautious for undroppable items with this...