SA-MP Forums Archive
[Ajuda] kill spree - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] kill spree (/showthread.php?tid=542067)



kill spree - Lucas_HenryK - 16.10.2014

queria saber como faзo para saber se o jogador matou 2 players seguidos ou mas em menos de 3 segundos


Re: kill spree - VeNuZ_ - 16.10.2014

pawn Код:
new TempoKill[MAX_PLAYERS];
new Kills[MAX_PLAYERS];

public OnPlayerDeath(playerid, killerdid, reason)
{ if(killerid == -1) return 1;
if(TempoKill[killerid] >= gettime()){
Kills[killerid]++;
TempoKill[killerid] = gettime()+ 3;

}else {
TempoKill[killerid] =0;
Kills[killerid]=0;
}
}



Re: kill spree - Lucas_HenryK - 16.10.2014

pawn Код:
public OnPlayerDeath(playerid, killerid, reason){
    SendDeathMessage(killerid,playerid,reason);

    PlayerInfo[killerid][Kills] ++;
    KillsSeguidos[killerid] ++;
   
    PlayerInfo[playerid][Deaths] ++;
    KillsSeguidos[playerid] = 0;

    if(KillsSeguidos[killerid] == 1) {
        TextDrawShowForPlayer(killerid,TextDraw[1]);
        SetTimer("ApagaText1",1000,false);
    }
   
    switch(KillsSeguidos[killerid])
    {
        case 2: {
            TextDrawSetString(TextDraw[2],"Double Kill!");
            TextDrawShowForPlayer(killerid,TextDraw[2]);
        }
        case 3: {
            TextDrawSetString(TextDraw[2],"Triple Kill!");
            TextDrawShowForPlayer(killerid,TextDraw[2]);
        }
    }
    SetTimer("SpreeKilling",5000,false);
    SetTimer("ApagaTextSpree",2000,false);
    return 1;
}
sу estas a funcionar bem para quando es id 0 no servidor