28.12.2017, 22:59
PHP код:
public OnPlayerDeath(playerid, killerid, reason)
{
new
playerKills[MAX_PLAYERS][rankingEnum],
index
;
for(new i; i != MAX_PLAYERS; ++i)
{
if(IsPlayerConnected(i) && !IsPlayerNPC(i))
{
playerKills[index][player_Kill] = GetPlayerKills(i);
playerKills[index++][player_ID] = i;
}
}
GetPlayerHighestKills(playerKills, 0, index);
new
score_Text[256] = "~n~",
player_Name[50]
;
for(new i; i < 5; ++i)
{
if(i < index)
{
GetPlayerName(playerKills[i][player_ID], player_Name, sizeof(player_Name));
format(score_Text, sizeof(score_Text), "%s~n~~b~%d. ~w~%s - ~r~%d", score_Text, i + 1, player_Name, playerKills[i][player_Kill]);
}
else
format(score_Text, sizeof(score_Text), "%s~n~~b~%d. ~r~N/A", score_Text, i + 1);
}
TextDrawSetString(text_Top5[1], score_Text);
TextDrawShowForPlayer(playerid, text_Top5[0]);
TextDrawShowForPlayer(playerid, text_Top5[1]);
return 1;
}