ArrayDeleteItem() - Delete First Entry
I have an array, visually would look like this:
Code:
Slot 1: STEAM_ID_LAN|PLAYER: Hello World 1Code:
EDIT: I apparently can't think - id just snip the thread, but my fix obvious is to use "ArrayDeleteItem(g_NewspaperArray,Count - MAX_ADS)" |
Re: ArrayDeleteItem() - Delete First Entry
ArrayDeleteItem( g_NewspaperArray , 0 );?
I'm assuming this array holds data for each player so it will not be in order so using just 0 will not always work properly. Maybe you can include a timestamp (get_systime()) in the string and use that to delete the oldest? Then scan through items and find the entry with oldest timestamp (get_systime()-timestamp) and delete that one? I don't understand 100% what you are trying to do, if you can explain further I can probably provide a better answer, or attempt to atleast. |
Re: ArrayDeleteItem() - Delete First Entry
Quote:
Is one of those two things not true with dynamic arrays? |
Re: ArrayDeleteItem() - Delete First Entry
Console command add\delete will show order in which items are added\removed. If you're always trying to remove the oldest item added to your array then using ArrayDeleteItem( g_NewspaperArray, 0 ) should always work.
PHP Code:
|
| All times are GMT -4. The time now is 08:41. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.