SA-MP Forums Archive
OnPlayerTakeDamage doesn't work? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: OnPlayerTakeDamage doesn't work? (/showthread.php?tid=410864)



OnPlayerTakeDamage doesn't work? - Mado - 27.01.2013

Hi, I made this and I put it below OnPlayerTakeDamage:

pawn Код:
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);
                }
               
               
            }
But it does not work. The pDamage is probably not added, but what did I do wrong in here?