Drop System idea help
#1

Hi, I made a basic drop system that works perfectly. Now I want a system that sets a maximum of dropped items (DEFINE MAX_DROP_ITEM 50). I wish that when an item is dropped halfway, the oldest item is deleted, so do remain a number of items on the server. Any of you have an idea on how to do it?
Reply
#2

Some pseudo-code of what I thought of:
Code:
#define MAX_DROPPED_ITEMS = 50
new lastDroppedItemIndex = 0
new droppedItems[MAX_DROPPED_ITEMS]

function DropItem(item) {
if lastDroppedItemIndex == 50 then
  lastDroppedItemIndex = 0

droppedItems[lastDroppedItemIndex] = item
lastDroppedItemIndex++
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)