[Ajuda] Ajuda No-Lag
#5

Tem que fazer uma correзгo. Nisto

pawn Код:
new killedBY[MAX_PLAYERS] = {-1, ...};

public  OnPlayerConnect(playerid)
{
    killedBY[playerid] = -1;
    // resto do cуdigo da sua OnPlayerConnect
}
public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid)
{
    new Float:Life, Float:Coleete, Float:Dano;
    GetPlayerArmour(damagedid, Coleete);
    GetPlayerHealth(damagedid, Life);
    if(Coleete > 0)
    {
        if(amount > Coleete)
        {
            Dano = amount - Coleete;
            Life = Life - Dano;
            SetPlayerArmour(damagedid, 0.0);
            SetPlayerHealth(damagedid, Life);
            return 1;
        }
        Coleete = Coleete - amount;
        SetPlayerArmour(damagedid, Coleete);
    }
    if(Coleete < 1)
    {
        Life = Life - amount;
        SetPlayerHealth(damagedid, Life);

        if(Life < 0.0) {

            killedBY[damageid] = playerid;

        }
    }
    return 1;
}

public OnPlayerDeath(playerid,killerid, reason) {

    if(!IsPlayerConnected(killerid) && IsPlayerConnected(killedBY[playerid]))
        killerid  = killedBY[playerid], killedBY[playerid] = -1;

    // resto do cуdigo da sua onplayerdeath
}
Reply


Messages In This Thread
Ajuda No-Lag - by Menor - 18.10.2013, 00:50
Re: Ajuda No-Lag - by arakuta - 18.10.2013, 01:12
Re: Ajuda No-Lag - by Menor - 18.10.2013, 01:20
Re: Ajuda No-Lag - by Falcon. - 18.10.2013, 04:05
Respuesta: Ajuda No-Lag - by ipsBruno - 18.10.2013, 07:52
Re: Ajuda No-Lag - by Menor - 18.10.2013, 19:15
Re: Ajuda No-Lag - by arakuta - 18.10.2013, 21:30
Re: Ajuda No-Lag - by Menor - 18.10.2013, 21:36
Respuesta: Ajuda No-Lag - by ipsBruno - 18.10.2013, 22:14
Re: Ajuda No-Lag - by Menor - 18.10.2013, 23:18

Forum Jump:


Users browsing this thread: 1 Guest(s)