Not taking damage when under x health problem
#1

Hello, I have a small problem when creating a script in my server, it works all good with one small exception, when the player B is under the custom made damage of a weapon, he won't take any damage at all. I will post the script under me.
PHP код:
public OnPlayerTakeDamage(playeridissueridFloatamountweaponidbodypart)
{
     new
     
Float:health,
     
Float:armour
     
;
    
GetPlayerHealth(playeridhealth);
    
GetPlayerArmour(playeridarmour);
    switch(
weaponid
    
    {
  case 
24// Desert Eagle weapon ID
{
    switch(
armour
    {
        case 
0
        {
           switch(
bodypart
{
    case 
3SetPlayerHealth(playeridhealth 70); // Torso.
    
case 4SetPlayerHealth(playeridhealth 65); // Groin.
    
case 5SetPlayerHealth(playeridhealth 40);  // Left Arm.
    
case 6SetPlayerHealth(playeridhealth 40); // Right Arm.
    
case 7SetPlayerHealth(playeridhealth 40);  // Left Leg.
    
case 8SetPlayerHealth(playeridhealth 40); // Right Leg.
    
case 9SetPlayerHealth(playeridhealth 100); // Head.
}
        }
        default:
        {
        switch(
bodypart)
        {
        case 
3SetPlayerArmour(playeridhealth 70); // Torso.
    
case 4SetPlayerArmour(playeridhealth 65); // Groin.
    
case 5SetPlayerArmour(playeridhealth 40);  // Left Arm.
    
case 6SetPlayerArmour(playeridhealth 40); // Right Arm.
    
case 7SetPlayerArmour(playeridhealth 40);  // Left Leg.
    
case 8SetPlayerArmour(playeridhealth 40); // Right Leg.
    
case 9SetPlayerArmour(playeridhealth 100); // Head.
    
}
    }
    }
        } 
Reply
#2

OnPlayerTakeDamage means when player take damage try this include.
https://sampforum.blast.hk/showthread.php?tid=195439
and use it like
Код:
public OnPlayerShootPlayer(Shooter,Target,Float:HealthLost,Float:ArmourLost)
{
    Your Code...
    return 1;
}
Reply
#3

Quote:
Originally Posted by FuNkYTheGreat
Посмотреть сообщение
OnPlayerTakeDamage means when player take damage try this include.
https://sampforum.blast.hk/showthread.php?tid=195439
and use it like
Код:
public OnPlayerShootPlayer(Shooter,Target,Float:HealthLost,Float:ArmourLost)
{
    Your Code...
    return 1;
}
Isn't OnPlayerShootPlayer outdated and a .pwn based include? Why OnPlayerTakeDamage wouldn't work?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)