Hello everybody,
For my ranking system I need to know who is the first / second etc. place of a race. For this I use this code :
PHP Code:
new PlayerZ[32], id2, Amount = g_PartyData[id][Amount_In_Party]
get_party_index(id, PlayerZ)
static PlayersFinished = 0
for(new i; i < Amount; i++)
{
id2 = PlayerZ[i]
if(!g_bIsInRace[id2])
PlayersFinished++
}
for(new i; i < Amount; i++)
{
id2 = PlayerZ[i]
switch(PlayersFinished)
{
case 1:
{
g_PartyData[id2][FIRST] = id
client_print(0, print_chat, "[DEBUG] %i is first player.", id)
}
case 2:
{
g_PartyData[id2][SECOND] = id
client_print(0, print_chat, "[DEBUG] %i is second player.", id)
}
case 3:
{
g_PartyData[id2][THIRD] = id
client_print(0, print_chat, "[DEBUG] %i is third player.", id)
}
case 4:
{
g_PartyData[id2][FOURTH] = id
}
case 5:
{
g_PartyData[id2][FIFTH] = id
}
case 6:
{
g_PartyData[id2][SIXTH] = id
}
case 7:
{
g_PartyData[id2][SEVENTH] = id
}
case 8:
{
g_PartyData[id2][EIGHTH] = id
}
}
}
if(PlayersFinished == g_PartyData[id][Amount_In_Party])
{
calculate_players_elo(id)
}
But it always shows the second player as third (printing out ""[DEBUG] %i is third player.", id)") and the function "calculate_players_elo(id)" never gets executed.
Anyone knows what I'm doing wrong or has better idea how to do this?
__________________