PHP код:
new Slot1 = -1, Slot2 = -1, Slot3 = -1, Slot4 = -1, Slot5 = -1, Highestkills = 0;
new Text:Textdraw0;
public OnGameModeInit()
{
Textdraw0 = TextDrawCreate(476.875000, 216.833282, " ");
TextDrawLetterSize(Textdraw0, 0.400000, 1.600000);
TextDrawTextSize(Textdraw0, 621.000000, 0.000000);
TextDrawAlignment(Textdraw0, 1);
TextDrawColor(Textdraw0, -1);
TextDrawUseBox(Textdraw0, 1);
TextDrawBoxColor(Textdraw0, 255);
TextDrawSetShadow(Textdraw0, 0);
TextDrawSetOutline(Textdraw0, 0);
TextDrawBackgroundColor(Textdraw0, 255);
TextDrawFont(Textdraw0, 1);
TextDrawSetProportional(Textdraw0, 1);
TextDrawSetShadow(Textdraw0, 0);
return 1;
}
CMD:showtop(playerid, params[])
{
/*Note:
You have to change your kills variable with PlayerInfo[x][kills]
*/
for(new x=0; x<MAX_PLAYERS; x++) if (IsPlayerConnected(x)) if (PlayerInfo[x][kills] >= Highestkills)
{
Highestkills = PlayerInfo[x][kills];
Slot1 = x;
}
Highestkills = 0;
for(new x=0; x<MAX_PLAYERS; x++) if (IsPlayerConnected(x) && x != Slot1) if (PlayerInfo[x][kills] >= Highestkills)
{
Highestkills = PlayerInfo[x][kills];
Slot2 = x;
}
Highestkills = 0;
for(new x=0; x<MAX_PLAYERS; x++) if (IsPlayerConnected(x) && x != Slot1 && x != Slot2) if (PlayerInfo[x][kills][x] >= Highestkills)
{
Highestkills = PlayerInfo[x][kills];
Slot3 = x;
}
Highestkills = 0;
format(string, sizeof(string), "_______Top_3_Killers~n~~n~1-~g~~y~%s_(Kills_%d)~n~~n~", PlayerName(Slot1), PlayerInfo[Slot1][kills]);
if(Slot2 != -1)
{
format(string, sizeof(string), "_______Top_3_Killers~n~~n~1-~g~%s_(Kills_%d)~n~2-~y~%s_(Kills_%d)~n~~n~", PlayerName(Slot2),PlayerInfo[Slot2][kills]);
}
if(Slot3 != -1)
{
format(string, sizeof(string), "_______Top_3_Killers~n~~n~1-~g~%s_(Kills_%d)~n~2-~y~%s_(Kills_%d)~n~3-~y~%s_(Kills_%d)~n~~n~", PlayerName2(Slot3), PlayerInfo[Slot3][kills]);
}
TextDrawSetString(Textdraw0, string);
TextDrawShowForPlayer(playerid, Textdraw0);
return 1;
}