Difference between revisions of "Introduction to Pluggy Arrays"
→Example: Expanding example
imported>Speedo (Finished) |
imported>Speedo (→Example: Expanding example) |
||
Line 133: | Line 133: | ||
DestroyArray pInventory | DestroyArray pInventory | ||
DestroyArray pItemCount | DestroyArray pItemCount | ||
</pre> | |||
In order to see the player had an item, the following code could be used: | |||
<pre> | |||
set item to MyItem | |||
set index to FindRefInArray pInventory item | |||
if (index > -1) | |||
set tCount to GetInArray pItemCount index | |||
;Player has MyItem, tCount now holds how many he has | |||
;Do something with this info | |||
else | |||
;Player doesn't have MyItem | |||
endif | |||
</pre> | </pre> | ||