5 latest deaths/cmds/advs?
#1

Is there any way like I can script the latest 5 deaths just like on death-tab? Textdraws etc.
Reply
#2

Yes, you can.
Reply
#3

Can you give me an example? 'scripting help'
Reply
#4



Your original question has two possible answers: yes and no. What you meant to ask was how or what. And in that case the answer would be: create a global two-dimensional array like "gJoins[5][MAX_PLAYER_NAME]".

If the new entry is to be added at the end of the list you first shift the array downwards in order to free the last slot, thereby discarding entry in the first slot. Then you write the new entry in slot 4. If you want to to add the new entry to the beginning of the list then you do the opposite. You shift everything upwards to free the first slot, thereby discarding the item in the last slot.

PHP Code:
new gJoins[5][MAX_PLAYER_NAME];

// shift down, discard first item
for(new isizeof(gJoins) - 1i++)
{
    
gJoins[i] = gJoins[1];
}

// write in the last slot (sizeof is 5, meaning the last slot is 5 - 1 = 4)
GetPlayerName(playeridgJoins[sizeof(gJoins) - 1], sizeof(gJoins[]));

// reshow the entire thing here 
I don't know if it will work exactly like that because I'm unable to test it right now. But that's the theory.
Reply
#5

Quote:
Originally Posted by Vince
View Post
...
And in that case the answer would be: create a global two-dimensional array like "gJoins[5][MAX_PLAYER_NAME + 1]".
...
For null terminator.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)