Help me...
#1

Hi all, i have create a simple DM Gamemode, and 1 Kill add in a Stats a Var_Kill...
How i can made Function "BestKiller" of match?
Thanks.
Reply
#2

what are you using 0.3c or 0.3b
Reply
#3

Quote:
Originally Posted by Mehtab
Посмотреть сообщение
what are you using 0.3c or 0.3b
Would that make a difference? ...No. It wouldn't. Anyways, run a loop through all players, and find a player with highest kills according to your saving system.
Reply
#4

I use 0.3c
Reply
#5

Quote:

Anyways, run a loop through all players, and find a player with highest kills according to your saving system.

I know this, but please can write an example?
Reply
#6

Код:
//----//Rank Stuff//----//
enum pinfo
{
    MinutesPlayed,
    HoursPlayed,
    Kills,
    Visits,
    Rank,
    SaveStats,
}
new PInfo[MAX_PLAYERS][pinfo];
Код:
//----//Requierments//----//
enum rinfo
{
    RName[64],
    RRequirement,
    RStartMoney,
    Float:RSpawnHealth,
    Float:RSpawnArmour,
    RSpawnWeapon,
    RSpawnAmmo,
};

new RankInfo[MAX_RANKS][rinfo];
Код:
AddRank(rankID, const Name[], Requirement, Startmoney, Float:SpawnHealth, Float:SpawnArmour, SpawnWeapon, SpawnAmmo);
Reply
#7

Mmmh no Mehtab i need a Function for BestKiller, the Player that have a "BestScore"...
Reply
#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
#9

Wao thanks Mehtab +__+
Reply
#10

need other help then PM me
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)