Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.
GTAONLINE.PL
Tematy otagowane jako: zabitych
1. Naliczanie zabitych slothbotow
Siema, chcialbym aby naliczalo ile dana osoba zabila slothbotow, mam taki kod ale nie dziala :C
 addEventHandler("onPedWasted",root,function (killer)
    if 
killer then
        
if getElementData(source,"slothbot"then
            local kills 
getElementData(killer,"zabite:boty")
            
setElementData(killer,"zabite:boty",kills+1)
        
end
    end
    end
2. [INNE] Zapisanie śmierci oraz ilość zabitych
Witam mam taki kod.

Kod:


new Kills[MAX_PLAYERS];
new Deaths[MAX_PLAYERS];

//onplayerdisconnect
dini_IntSet(PlayerName(playerid), "Kills", Kills[playerid]);
dini_IntSet(PlayerName(playerid), "Deaths", Deaths[playerid]);

OnPlayerDeath
Kills[killerid] ++; //increases the killers "kills" stats by 1
Deaths[playerid] ++; //increases the player who died "deaths" stats by 1.

to do logowania
Kills[playerid] = dini_Int(PlayerName(playerid), "Kills");
Deaths[playerid] = dini_Int(PlayerName(playerid), "Deaths");

A to do rejestracji
dini_IntSet(PlayerName(playerid), "Deaths", 0);
dini_IntSet(PlayerName(playerid), "Kills", 0);

//komenda
COMMAND:stats2(playerid, params[])
{
new string1[126];
new plname[25];
GetPlayerName(playerid, plname, 25);
new Float:ratio=floatdiv(Kills[playerid], Deaths[playerid]); //also added in a K/D Ratio for you you can just delete it if you don't want it.
format(string1, sizeof(string1), "%s's Stats: Kills: %d, Deaths %d, K/D Ratio: %.2f", plname,Kills[playerid],Deaths[playerid],ratio);
SendClientMessage(playerid,ORANGE, string1);
return 1;
}



Wszystko si? komplikuje. I jak si? zabije to i tak wynosi "0" pomo?ecie? ;)