CMD /top10
#1

Can someone make CMD /top10, it show top 10 killers simple:

1. Nickname [Kills]
2. Nicknamee [Kills]
Reply
#2

Wrong section mate Post it here
Reply
#3

up...
Reply
#4

Up, help..
Reply
#5

Do you have a variable for saving player kills? Like pInfo[playerid][pKills] or Kills[playerid]
Reply
#6

hi, im kinda new to this scripting in sa:mp and i got a question about how to make the command /top15 for my server ?

I would like a table to popout when you do /top15 and on it like this:

TOP 15 LIST

1. <username> <kills> <deaths> <k/d rate>
2. -||-
3. -||-
...

Can someone help me please ?
Reply
#7

You need to add a system that will save the variables. In this case the variables are the Kills, Deaths and the K/D rate of the player.
Reply
#8

Just created this example. Hope this would be help full

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/top", true) == 0) {
        new
            string[ 128 ], First_Killer = -1, Second_Killer = -1, Third_Killer = -1, Fourth_Killer = -1, HighestKills = -9999;

        foreach(Player, x )
        if( PlayerInfo[ x ][ Kills ] >= HighestKills ) {
            HighestKills = PlayerInfo[ x ][ Kills ];
            First_Killer = x;
        }
        HighestKills = -9999;
        for( new x = 0; x < MAX_PLAYERS; x ++ )
            if( IsPlayerConnected( x ) && x != First_Killer )
            if( PlayerInfo[ x ][ Kills ] >= HighestKills ) {
                HighestKills = PlayerInfo[ x ][ Kills ];
                Second_Killer = x;
        }
        HighestKills = -9999;
        for( new x = 0; x < MAX_PLAYERS; x ++ )
            if( IsPlayerConnected( x ) && x != First_Killer && x != Second_Killer )
            if( PlayerInfo[ x ][ Kills ] >= HighestKills ) {
                HighestKills = PlayerInfo[ x ][ Kills ];
                Third_Killer = x;
        }
        HighestKills = -9999;
        for( new x = 0; x < MAX_PLAYERS; x ++ )
            if( IsPlayerConnected( x ) && x != First_Killer && x != Second_Killer && x != Third_Killer )
            if( PlayerInfo[ x ][ Kills ] >= HighestKills ) {
                HighestKills = PlayerInfo[ x ][ Kills ];
                Fourth_Killer = x;
        }
        format( string, sizeof( string ), "Player %s (%d) - %d Kills", GetName(First_Killer ), First_Killer, PlayerInfo[ First_Killer ][ Kills ] );
        SendClientMessage( playerid, -1, string );
        if( Second_Killer != -1) {
            format( string, sizeof( string ), "Player %s (%d) - %d Kills", GetName(Second_Killer ), Second_Killer, PlayerInfo[ Second_Killer ][ Kills ] );
            SendClientMessage( playerid, -1, string );
        }
        if( Third_Killer != -1) {
            format( string, sizeof( string ), "Player %s (%d) - %d Kills", GetName(Third_Killer ), Third_Killer, PlayerInfo[ Third_Killer ][ Kills ] );
            SendClientMessage( playerid, -1, string );
        }
        if( Fourth_Killer != -1) {
            format( string, sizeof( string ), "Player %s (%d) - %d Kills", GetName(Fourth_Killer ), Fourth_Killer, PlayerInfo[ Fourth_Killer ][ Kills ] );
            SendClientMessage( playerid, -1, string );
        }
        return 1;
    }
    return 0;
}

GetName( playerid )
{
    new Name[ MAX_PLAYER_NAME ];
    GetPlayerName( playerid, Name, sizeof( Name ) );
    return Name;
}
Don't forget to download and include foreach
pawn Код:
#include <foreach>
Reply
#9

hmm so this would be the in filterscripts ? the code i mean and George with the system you mean a mysql base ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)