SA-MP Forums Archive
Check Kills - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Check Kills (/showthread.php?tid=179442)



Check Kills - Lorrden - 26.09.2010

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


Re: Check Kills - Kitten - 26.09.2010

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


Re: Check Kills - Lorrden - 29.09.2010

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.


Re: Check Kills - LarzI - 29.09.2010

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?


Re: Check Kills - Lorrden - 29.09.2010

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...