[PROBLEM] Top 5 - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [PROBLEM] Top 5 (
/showthread.php?tid=421268)
[PROBLEM] Top 5 -
Loox - 08.03.2013
Well, I have a little problem with this code.
Код:
new
playerScores[MAX_PLAYERS][ranking],
index
;
for(new i; i != MAX_PLAYERS; ++i)
{
if(IsPlayerConnected(i) && !IsPlayerNPC(i))
{
playerScores[index][player_Score] = GetPlayerScore(i);
playerScores[index++][player_ID] = i;
}
}
GetPlayerHighestScores(playerScores, 0, index);
new
score_Text[256] = "~n~",
player_Name[20]
;
for(new i; i < 5; ++i)
{
if(i < index)
{
GetPlayerName(playerScores[i][player_ID], player_Name, sizeof(player_Name));
format(score_Text, sizeof(score_Text), "%s~n~~b~%d. ~r~%s - ~w~%d - ~r~%0.2f", score_Text, i + 1, player_Name, playerScores[i][player_Score], Float:pInfo[i][pKills]/Float:pInfo[i][pDeaths]);
}
else
format(score_Text, sizeof(score_Text), "%s~n~", score_Text);
}
TextDrawSetString(text_Top5[0], score_Text);
TextDrawShowForPlayer(playerid, text_Top5[0]);
TextDrawShowForPlayer(playerid, text_Top5[1]);
return 1;
}
I use the Top 5 script of Ryder.
I'm trying to add in the top 5 the kill ratio of the players, but when 2 players enter in the server the top 5 bugs. Have this code any error?
Regards.
Respuesta: [PROBLEM] Top 5 -
Loox - 09.03.2013
Bump, nobody?