OnPlayerTakeDamage
#1

Ok so I am trying to make a system so if you are using god mode from so be it, then you will still loose hp when shot, but it isn't working, anyone know why?


pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
    if(issuerid != INVALID_PLAYER_ID) { //Remove this if statement if you want EVERYTHING to do no damage (falls, explosions, ect still will)
        GivePlayerHealth( playerid, amount);
        if(GetPlayerWeapon(issuerid) == 24)
        {
            GivePlayerHealth(playerid, -46);
        }
    }
    return true;
}
Reply
#2

Godmode restores your HP so even if that works he just get 100hp again
Reply
#3

YOu can use OnPlayerShotPlayer Save his health in a float and if the player have lost 100 or more SetPlayerHealth(playerid,0);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)