OnPlayerTakeDamage doesn't work?
#10

This is the whole callback:

pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
{
    new points;
    new string[128];
    new Float:armour;
    GetPlayerArmour(playerid, armour);
    if(issuerid == INVALID_PLAYER_ID)
    {
        return 1;
    }
    if(GetPVarInt(playerid, "IsInArena") == 0)
    {
        if(GetPVarInt(playerid, "EventToken") == 0)
        {
            if(weaponid == 24) //deagle
            {
                if(armour > 0)
                {
                    pDamage[playerid] += 15;
                }
                else
                {
                    pDamage[playerid] += 30;
                }
            }
            else if(weaponid == 23) //sdpistol
            {
                if(armour > 0)
                {
                    pDamage[playerid] += 5;
                }
                else
                {
                    pDamage[playerid] += 10;
                }
            }
            else if(weaponid == 29) //MP5
            {
                if(armour > 0)
                {
                    pDamage[playerid] += 10;
                }
                else
                {
                    pDamage[playerid] += 15;
                }
            }
            else if(weaponid == 30 || weaponid == 31) //M4 - AK47
            {
                if(armour > 0)
                {
                    pDamage[playerid] += 10;
                }
                else
                {
                    pDamage[playerid] += 20;
                }
            }
            else if(weaponid == 25 || weaponid == 27) //Shotgun + SPAS12
            {
                if(armour > 0)
                {
                    if(ProxDetectorS(12.0, playerid, issuerid))
                    {
                        pDamage[playerid] += 25;
                    }
                    else
                    {
                        pDamage[playerid] += 15;
                    }
                }
                else
                {
                    if(ProxDetectorS(12.0, playerid, issuerid))
                    {
                        pDamage[playerid] += 35;
                    }
                    else
                    {
                        pDamage[playerid] += 20;
                    }
                }
            }
            else if(weaponid == 34) //Sniper
            {
                if(ProxDetectorS(60.0, playerid, issuerid))
                {
                    pDamage[playerid] += 50;
                }
                else
                {
                   pDamage[playerid] += 0;
                }
            }
            else if(weaponid == 33) //Rifle
            {
                pDamage[playerid] += 15;
            }
            if(pDamage[playerid] > 0)
            {
                pDamageTimer[playerid] = 120;
                GameTextForPlayer(playerid, "~r~You've been hit!", 1500, 1);
                if(pDamage[playerid] >= 100)
                {
                    format(string, sizeof(string), "* %s falls to the ground due to the bullet injuries.", GetPlayerNameEx(playerid));
                    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    ApplyAnimation(playerid, "KNIFE", "KILL_Knife_Ped_Die", 4.0, 0, 1, 1, 1, 0, 1);
                }
               
               
            }
        }
    }
    return 1;
}
Reply


Messages In This Thread
OnPlayerTakeDamage doesn't work? - by Mado - 08.02.2013, 17:02
Re: OnPlayerTakeDamage doesn't work? - by Alternative112 - 08.02.2013, 17:54
Re: OnPlayerTakeDamage doesn't work? - by Mado - 08.02.2013, 21:30
Re: OnPlayerTakeDamage doesn't work? - by Mado - 10.02.2013, 15:11
Re: OnPlayerTakeDamage doesn't work? - by Mado - 11.02.2013, 19:07
Re: OnPlayerTakeDamage doesn't work? - by MP2 - 11.02.2013, 19:09
Re: OnPlayerTakeDamage doesn't work? - by Mado - 11.02.2013, 19:38
Re: OnPlayerTakeDamage doesn't work? - by DaRk_RaiN - 11.02.2013, 20:00
Re: OnPlayerTakeDamage doesn't work? - by Mado - 12.02.2013, 06:42
Re: OnPlayerTakeDamage doesn't work? - by Mado - 13.02.2013, 05:21

Forum Jump:


Users browsing this thread: 2 Guest(s)