23.02.2011, 17:15
hi,
like the title says.
this code i dont know why, sometimes crashes my server.
Only if there is only 1 player in the server it never crashes.
This is comparing the kills of a player and then it shows the top 5 players currently playing on the server.
hope someone can help me cause i just dont know what to do.
regards...
like the title says.
this code i dont know why, sometimes crashes my server.
Only if there is only 1 player in the server it never crashes.
This is comparing the kills of a player and then it shows the top 5 players currently playing on the server.
pawn Код:
//kills are counted like this:
kills[killerid]++; //under OnPlayerDeath
new TotalScores[6];
new TotalPlayers[6];
new PlayerScore[2];
new PlayerID[2];
for(new i; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
PlayerScore[0] = kills[i]; //kills
PlayerID[0] = i;
for(new place; place < sizeof(TotalScores); place++)
{
if(PlayerScore[0] > TotalScores[place])
{
strins(TotalScores, PlayerScore, place);
strins(TotalPlayers, PlayerID, place);
place = sizeof(TotalScores);
}
}
}
}
regards...