Check Kills
#1

This is what I want to know;

How do I do to check if a player has more kills than the others?
I have a variable, and I have a timer. All I need is to know how do I make the server see that ONE player has more than the other players has.

Thanks
Reply
#2

so like

pawn Код:
new Kills[MAX_PLAYERS];
pawn Код:
public OnPlayerDeath(playerid,killerid);
{
         new Kills[killerid] = GetPlayerScore(playerid);
         if(Kills[killerid] == 5)
         {
                GameTextForPlayer(playerid,"~r~ Your Text",6000,3);
         }
         return 1;
}
not tested
Reply
#3

No.. More like;

pawn Код:
if(PlayerHasMostKills(playerid)) GameTextForPlayer(playerid, "~r~ my text", 6000, 3);
I just don't know how to check if a player has more kills than the other players.
Reply
#4

pawn Код:
//global
new
    g_PlayerKillsVar[ MAX_PLAYERS ],
    g_MostKills,
    g_Leader = -1;
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    g_PlayerKillsVar[ killerid ]++;
    if( g_PlayerKillsVar[ killerid ] > g_MostKills )
    {
        g_Leader = killerid;
        g_MostKills = g_PlayerKillsVar[ killerid ];
    }
    return true;
}
Something like that?
Reply
#5

No that's not it...

This will only make the player Leader if he gets more kills than server rekord...
What I want is a function that makes the player with most kills "Online atm" a "Most Wanted" player...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)