Top killers and top killer
#1

Hey there!

I'm makeing a DM gamemode and i was wondering if it's possible to get a command which send you like the 3 top killers on /top3.

anyway, the code i actully know exsist is when the gamemode ends it displays a msg to all players that "%s has won the Deathmatch"

I was wondering if any1 have or can make these codes? or explain how to.

-Naxix
Reply
#2

pawn Код:
new Deaths[ MAX_PLAYERS ], Kills[ MAX_PLAYERS ];

public OnPlayerConnect( playerid )
{
    Deaths[ playerid] = 0;
    Kills[ playerid ] = 0;
    return 1;
}

public OnGameModeExit()
{
    new string[ 128 ], name[ MAX_PLAYER_NAME ], bestkiller, bestkillerkills;
   
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if( bestkillerkills > Kills[ i ] )
        {
          bestkiller = i;
          bestkillerkills, Kills[ i ]
        }
    }
   
    GetPlayerName( playerid, name, sizeof( name ) );
    format( string, sizeof( string ), "%s has won the round!", name );
    SendClientMessageToAll( COLOR, string );
   
    return 1;
}

public OnPlayerDeath( playerid, killerid, reason )
{
    Kills[killerid]++;
    Deaths[playerid]++;
    return 1;
}
Something like that, I'm extremely tired so it's probably completely illogical.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)