SA-MP Forums Archive
[Ajuda] BUG 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] BUG SPREE (/showthread.php?tid=605743)



BUG SPREE - maxblaya01 - 24.04.2016

ALGUEM AE PODE ME AJUDAR?, QUANDO UM PLAYER MATA O OUTRO, O SPREE CONTA PROS 2 PLAYERS COMO FAЗO PARA CONCERTAR ISSO?, ESTA AE UMA PARTE DO CODIGO.
Код:
new Text:scoreandping[MAX_PLAYERS];
new Updater;
new pkills[MAX_PLAYERS];


forward ScorenPing(playerid);

public ScorenPing(playerid)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            new string[256];
            format(string,sizeof(string)," ~w~] ~r~~h~Score: ~w~%d~n~ ~w~] ~r~~h~Ping: ~w~%d~n~ ~w~] ~r~~h~Fps: ~w~%d~n~ ~w~] ~r~~h~Spree: ~w~%d",GetPlayerScore(i),GetPlayerPing(i),GetPlayerFPS(i),pkills);
            TextDrawSetString(scoreandping[i], string);
        }
    }
}

public OnPlayerDeath(playerid, killerid, reason)
{
    pkills[playerid] = 0;
    pkills[killerid]++;
    GameTextForPlayer(killerid,"~r~+1 ~w~Kill!",1500,6);
    return 1;
}

stock GetPlayerFPS(playerid)
{
    SetPVarInt(playerid, "DrunkL", GetPlayerDrunkLevel(playerid));
    if(GetPVarInt(playerid, "DrunkL") < 100)
    {
        SetPlayerDrunkLevel(playerid, 2000);
    }
    else
    {
        if(GetPVarInt(playerid, "LDrunkL") != GetPVarInt(playerid, "DrunkL"))
        {
            SetPVarInt(playerid, "FPS", (GetPVarInt(playerid, "LDrunkL") - GetPVarInt(playerid, "DrunkL")));
            SetPVarInt(playerid, "LDrunkL", GetPVarInt(playerid, "DrunkL"));
            if((GetPVarInt(playerid, "FPS") > 0) && (GetPVarInt(playerid, "FPS") < 256))
            {
                return GetPVarInt(playerid, "FPS") - 1;
            }
        }
    }
    return 0;
}



Re: BUG SPREE - F1N4L - 24.04.2016

Tenta usar essa condicional:

Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(killerid != INVALID_PLAYER_ID)
       pkills[killerid]++,
       GameTextForPlayer(killerid,"~r~+1 ~w~Kill!",1500,6);

    pkills[playerid] = 0;
    return 1;
}



Re: BUG SPREE - ElMagicoR - 24.04.2016

new totalkills[MAX_PLAYERS] = 0;
public OnPlayerDeath(playerid, killerid, reason)
{
new string[128];
new emris[128]; // emris = name
GetPlayerName(killerid, emris, sizeof(emris));

totalkills[killerid]++;
totalkills[playerid] = 0;

if(totalkills[killerid] == 6) {
format(string, sizeof(string), "SERVER: %s KILLING SPREE", emris);
SendClientMessageToAll(-1, string);
return 1;
}
return 1;
}


Re: BUG SPREE - maxblaya01 - 24.04.2016

Quote:
Originally Posted by F1N4L
Посмотреть сообщение
Tenta usar essa condicional:

Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(killerid != INVALID_PLAYER_ID)
       pkills[killerid]++,
       GameTextForPlayer(killerid,"~r~+1 ~w~Kill!",1500,6);

    pkills[playerid] = 0;
    return 1;
}
Continua bugando ainda