PDA

View Full Version : Help for public OnPlayerTakeDamage about not reduced of armor


Lloyde
15/04/2014, 12:22 PM
How Does it properly, because when the life of the player full health and armor when I first shot reduces the life armor is not reduced. Is there help me how to fix it?


public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
new Float:HP;
GetPlayerHealth(playerid, HP);
if(issuerid != INVALID_PLAYER_ID)
{
switch(weaponid)
{
case 22:
{
switch(bodypart)
{
case 3: SetPlayerHealth(playerid, HP-13); // Torso
case 4: SetPlayerHealth(playerid, HP-8); // Groin
case 5: SetPlayerHealth(playerid, HP-5); // Left ARM
case 6: SetPlayerHealth(playerid, HP-5); // Right ARM
case 7: SetPlayerHealth(playerid, HP-5); // Left Leg
case 8: SetPlayerHealth(playerid, HP-5); // Right Leg
case 9: SetPlayerHealth(playerid, HP-26); // Head
}
}
case 23:
{
switch(bodypart)
{
case 3: SetPlayerHealth(playerid, HP-15); // Torso
case 4: SetPlayerHealth(playerid, HP-12); // Groin
case 5: SetPlayerHealth(playerid, HP-5); // Left ARM
case 6: SetPlayerHealth(playerid, HP-5); // Right ARM
case 7: SetPlayerHealth(playerid, HP-5); // Left Leg
case 8: SetPlayerHealth(playerid, HP-5); // Right Leg
case 9: SetPlayerHealth(playerid, HP-25); // Head
}
}
case 24:
{
switch(bodypart)
{
case 3: SetPlayerHealth(playerid, HP-23); // Torso
case 4: SetPlayerHealth(playerid, HP-20); // Groin
case 5: SetPlayerHealth(playerid, HP-15); // Left ARM
case 6: SetPlayerHealth(playerid, HP-15); // Right ARM
case 7: SetPlayerHealth(playerid, HP-15); // Left Leg
case 8: SetPlayerHealth(playerid, HP-15); // Right Leg
case 9: SetPlayerHealth(playerid, HP-67); // Head
}
}
case 25:
{
switch(bodypart)
{
case 3: SetPlayerHealth(playerid, HP-30); // Torso
case 4: SetPlayerHealth(playerid, HP-27); // Groin
case 5: SetPlayerHealth(playerid, HP-23); // Left ARM
case 6: SetPlayerHealth(playerid, HP-23); // Right ARM
case 7: SetPlayerHealth(playerid, HP-22); // Left Leg
case 8: SetPlayerHealth(playerid, HP-22); // Right Leg
case 9: SetPlayerHealth(playerid, HP-70); // Head
}
}
case 27:
{
switch(bodypart)
{
case 3: SetPlayerHealth(playerid, HP-20); // Torso
case 4: SetPlayerHealth(playerid, HP-14); // Groin
case 5: SetPlayerHealth(playerid, HP-10); // Left ARM
case 6: SetPlayerHealth(playerid, HP-10); // Right ARM
case 7: SetPlayerHealth(playerid, HP-9); // Left Leg
case 8: SetPlayerHealth(playerid, HP-9); // Right Leg
case 9: SetPlayerHealth(playerid, HP-70); // Head
}
}
case 28:
{
switch(bodypart)
{
case 3: SetPlayerHealth(playerid, HP-10); // Torso
case 4: SetPlayerHealth(playerid, HP-8); // Groin
case 5: SetPlayerHealth(playerid, HP-5); // Left ARM
case 6: SetPlayerHealth(playerid, HP-5); // Right ARM
case 7: SetPlayerHealth(playerid, HP-5); // Left Leg
case 8: SetPlayerHealth(playerid, HP-5); // Right Leg
case 9: SetPlayerHealth(playerid, HP-20); // Head
}
}
case 29:
{
switch(bodypart)
{
case 3: SetPlayerHealth(playerid, HP-10); // Torso
case 4: SetPlayerHealth(playerid, HP-8); // Groin
case 5: SetPlayerHealth(playerid, HP-5); // Left ARM
case 6: SetPlayerHealth(playerid, HP-5); // Right ARM
case 7: SetPlayerHealth(playerid, HP-5); // Left Leg
case 8: SetPlayerHealth(playerid, HP-5); // Right Leg
case 9: SetPlayerHealth(playerid, HP-20); // Head
}
}
case 30:
{
switch(bodypart)
{
case 3: SetPlayerHealth(playerid, HP-21); // Torso
case 4: SetPlayerHealth(playerid, HP-14); // Groin
case 5: SetPlayerHealth(playerid, HP-9); // Left ARM
case 6: SetPlayerHealth(playerid, HP-9); // Right ARM
case 7: SetPlayerHealth(playerid, HP-8); // Left Leg
case 8: SetPlayerHealth(playerid, HP-8); // Right Leg
case 9: SetPlayerHealth(playerid, HP-40); // Head
}
}
case 31:
{
switch(bodypart)
{
case 3: SetPlayerHealth(playerid, HP-21); // Torso
case 4: SetPlayerHealth(playerid, HP-14); // Groin
case 5: SetPlayerHealth(playerid, HP-9); // Left ARM
case 6: SetPlayerHealth(playerid, HP-9); // Right ARM
case 7: SetPlayerHealth(playerid, HP-8); // Left Leg
case 8: SetPlayerHealth(playerid, HP-8); // Right Leg
case 9: SetPlayerHealth(playerid, HP-40); // Head
}
}
case 32:
{
switch(bodypart)
{
case 3: SetPlayerHealth(playerid, HP-10); // Torso
case 4: SetPlayerHealth(playerid, HP-8); // Groin
case 5: SetPlayerHealth(playerid, HP-5); // Left ARM
case 6: SetPlayerHealth(playerid, HP-5); // Right ARM
case 7: SetPlayerHealth(playerid, HP-5); // Left Leg
case 8: SetPlayerHealth(playerid, HP-5); // Right Leg
case 9: SetPlayerHealth(playerid, HP-20); // Head
}
}
case 33:
{
switch(bodypart)
{
case 3: SetPlayerHealth(playerid, HP-26); // Torso
case 4: SetPlayerHealth(playerid, HP-15); // Groin
case 5: SetPlayerHealth(playerid, HP-10); // Left ARM
case 6: SetPlayerHealth(playerid, HP-14); // Right ARM
case 7: SetPlayerHealth(playerid, HP-10); // Left Leg
case 8: SetPlayerHealth(playerid, HP-14); // Right Leg
case 9: SetPlayerHealth(playerid, HP-40); // Head
}
}
case 34:
{
switch(bodypart)
{
case 3: SetPlayerHealth(playerid, HP-33); // Torso
case 4: SetPlayerHealth(playerid, HP-28); // Groin
case 5: SetPlayerHealth(playerid, HP-20); // Left ARM
case 6: SetPlayerHealth(playerid, HP-20); // Right ARM
case 7: SetPlayerHealth(playerid, HP-20); // Left Leg
case 8: SetPlayerHealth(playerid, HP-20); // Right Leg
case 9: SetPlayerHealth(playerid, HP-100); // Head
}
}
}
}
return 1;
}

denom
15/04/2014, 12:25 PM
This one should be useful http://forum.sa-mp.com/showpost.php?p=1770047&postcount=21

Isolated
15/04/2014, 12:28 PM
You don't reduce the armour. Only health using SetPlayerHealth.

Lloyde
15/04/2014, 12:28 PM
This is the body Shot i need the sample of body shot that armour first to reduced and next the health

Lloyde
15/04/2014, 12:32 PM
i want to deduct armor first and next one is the health when you shotted in any parts of the body