Top killers and top killer
#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


Messages In This Thread
Top killers and top killer - by Naxix - 02.03.2010, 13:57
Re: Top killers and top killer - by Calgon - 02.03.2010, 14:12

Forum Jump:


Users browsing this thread: 4 Guest(s)