SetPlayerTeam - Equal Death reason suicide.
#4

Here's The Code.
I Cant Make SendDeathMessage Work.
pawn Код:
// OnPlayerSpawn
SetPlayerTeam(playerid, 5)

// OnPlayerDeath
    if(pKillID[playerid] != INVALID_PLAYER_ID)
    {
         killerid = pKillID[playerid]; // 0
         
         SendDeathMessage(killerid,playerid,GetPlayerWeapon(killerid)),
            pKillID[playerid] = INVALID_PLAYER_ID;
    }

// OnPlayerGiveDamage
    if(damagedid != INVALID_PLAYER_ID)
    {
            new Float:health, Float:armour;
            GetPlayerHealth(damagedid, health);

            GetPlayerArmour(damagedid, armour);

            if(armour > 0.0)
            {
                armour -= amount;
                if(armour < 0.0) {
                    SetPlayerArmour(damagedid, 0.0);
                    if(health+(armour) <= 0.0) pKillID[damagedid] = playerid;
                    SetPlayerHealth(damagedid, health+(armour));
                    return true;
                }
                SetPlayerArmour(damagedid, armour);
            }
            else{
                health -= amount;
                if(health <= 0.0) pKillID[damagedid] = playerid;
                SetPlayerHealth(damagedid, health);
            }
    }
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)