[Ajuda] BUG SPREE
#1

Ao matar o player para conseguir Spree, o player que matou ganha spree mas o que morreu tambem ganha, ai quando o outro mata, ae o que tinha ganhado quando morreu perde e o que tinha matado tambem perde os 2 perde ao mesmo tempo, como concerto?

Codigo:



Код:
#define FILTERSCRIPT

#include <a_samp>

new Text:scoreandping[MAX_PLAYERS];
new Updater;
new pkills[MAX_PLAYERS];


#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
        Updater = SetTimer("ScorenPing", 1000, 1);
        return 1;
}

public OnFilterScriptExit()
{
        KillTimer(Updater);
        return 1;
}
#endif

public OnPlayerRequestClass(playerid, classid)
{
    TextDrawHideForPlayer(playerid,scoreandping[playerid]);
    return 1;
}

public OnPlayerConnect(playerid)
{
    scoreandping[playerid] = TextDrawCreate(545.000000,338.000000,"_");
    TextDrawUseBox(scoreandping[playerid],1);
    TextDrawBoxColor(scoreandping[playerid],0x00000066);
    TextDrawTextSize(scoreandping[playerid],625.000000,-11.000000);
    TextDrawAlignment(scoreandping[playerid],0);
    TextDrawBackgroundColor(scoreandping[playerid],0x000000ff);
    TextDrawFont(scoreandping[playerid],2);
    TextDrawLetterSize(scoreandping[playerid],0.199999,1.100000);
    TextDrawColor(scoreandping[playerid],0xffffffff);
    TextDrawSetOutline(scoreandping[playerid],1);
    TextDrawSetProportional(scoreandping[playerid],1);
    TextDrawSetShadow(scoreandping[playerid],1);
    return 1;
}

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 OnPlayerDisconnect(playerid, reason)
{
        TextDrawDestroy(scoreandping[playerid]);
        return 1;
}

public OnPlayerSpawn(playerid)
{
    TextDrawShowForPlayer(playerid, scoreandping[playerid]);
    return 1;
}

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;
}
Reply
#2

Para de criar tуpicos duplos desnecessariamente!
Se nгo conseguiu a soluзгo no seu primeiro, espera o q do segundo?
Reply
#3

PHP код:
/* 
    OnPlayerDeath(playerid, killerid, reason)
    playerid - Jogador que morre
    killerid - Jogador que mata
*/

    
pkills[killerid]++;
    
pkills[playerid] = 0;
    
GameTextForPlayer(killerid"~r~+1 ~w~Kill!"15006); 
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)