Help me...
#8

Top of the script (under #include <a_samp>):
Код:
new Kills[MAX_PLAYERS], KillsOn;
OnPlayerCommandText:
Код:
if(strcmp("/startkillcount", cmdtext, true) == 0)
    {
        if(IsPlayerAdmin(playerid) == 0) return 0;
        KillsOn = 1;
        return 1;
    }
    if(strcmp("/endkillcount", cmdtext, true) == 0)
    {
        if(IsPlayerAdmin(playerid) == 0) return 0;
        KillsOf = 0;
        GetMaxKills();
        return 1;
    }



OnPlayerDeath:

Код:
if(KillsOn = 1)
    {
        Kills[playerid]++;
    }
Bottom of script, or not in another callback:
Код:
[GetMaxKills()
{
    new killerid;

    for(new a = 0; a < MAX_PLAYERS; a++)
    {
        for(new b = 0; b < MAX_PLAYERS; b++)
        {
            if(Kills[a] > Kills[b])
            {
                killerid = a;
            }
        }
    }

    new string[128];
    format(string, sizeof(string), "ID %d was the winner", killerid);
    SendClientMessageToAll(0xFFFFFFFF, string);
}
Reply


Messages In This Thread
Help me... - by Bogdanovic - 06.12.2010, 18:22
Re: Help me... - by Mehtab - 06.12.2010, 18:23
Re: Help me... - by WillyP - 06.12.2010, 18:25
Re: Help me... - by Bogdanovic - 06.12.2010, 18:26
Re: Help me... - by Bogdanovic - 06.12.2010, 18:28
Re: Help me... - by Mehtab - 06.12.2010, 18:31
Re: Help me... - by Bogdanovic - 06.12.2010, 18:36
Re: Help me... - by Mehtab - 06.12.2010, 18:39
Re: Help me... - by Bogdanovic - 06.12.2010, 18:41
Re: Help me... - by Mehtab - 06.12.2010, 18:44

Forum Jump:


Users browsing this thread: 2 Guest(s)