rendered paste bodypublic FindHighestScore(){
new Player_Score_Save = 0;
new Player_Score_ID = 0;
new Player_Score_ID2 = 0;
new Player_Draw_Check = 0;
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if (GetPlayerScore(i) > Player_Score_Save) {
Player_Score_Save = GetPlayerScore(i);
Player_Score_ID = i;
}
}
}
Player_Score_ID2 = 101;
for(new i=0; i<MAX_PLAYERS; i++)
{
if(Player_Score_ID != i){
if(IsPlayerConnected(i))
{
if (GetPlayerScore(i) == Player_Score_Save) {
Player_Score_ID2 = i;
Player_Draw_Check = 1;
}
}
}
}
new str1[STR_LEN] = "";
new str2[STR_LEN] = "";
new strFirstName[MAX_PLAYER_NAME] = "";
new strSecondName[MAX_PLAYER_NAME] = "";
if (Player_Draw_Check == 1) {
strFirstName = ReadPlayerName(Player_Score_ID);
strSecondName = ReadPlayerName(Player_Score_ID2);
format(str1, STR_LEN, "Players with the highest score: %s %s", strFirstName, strSecondName);
SendClientMessageToAll(COLOR_YELLOW, str1);
}
if (Player_Draw_Check == 0) {
strFirstName = ReadPlayerName(Player_Score_ID);
format(str2, STR_LEN, "Player with the highest score: %s", strFirstName);
SendClientMessageToAll(COLOR_YELLOW, str2);
}
}