Quote:
Originally Posted by Keeper
I've created an array of this type of structure from 0 to MAX_PLAYERS-1. Then I just access the array when I need to get info on a player's index. Of course I fill it on ClientActive and clear it on ClientDisconnect. That structure looks familiar
|
Heheheh it looks familiar
. So it is good method right?
But I am little confused.
Lets say
Code:
ClientActive
{
//METHOD 1
t_player player
player->name = "sdfdsfsdfsdf"
//METHOD 2
//OR SHOULD I DO THIS
player[engine->IndexOfEdict(pEntry)].name = "fsdfsdfsdfsdfsdfsdf"
}
Now If I always use method 1 then only the first element in the struct will be ALWAYS overwritten right? If so then I should use Method 2?
Quote:
I've created an array of this type of structure from 0 to MAX_PLAYERS-1.
|
Ok You have array and lets say there are 6 players online and in the array.
Then 7th player enters and how do you know what array index to use for the 7th players?
Hmmm I am confused with this struct little sorry
EDIT1: Hmmmmm I think your method with creating array from this struct is better but I still don't understand what player should be placed in what array index.