01.06.2014, 08:06
How to changed the Damage of Weapon?? for example i want to change the damage of Deagle to 1/4 of Life Damage instead of Half How?? can you show me the Code?
public OnPlayerTakeDamage( playerid, issuerid, Float:amount, weaponid )
{
new Float:h;
if (weaponid == 24)
{
if (amount >= 50)
{
GetPlayerHealth(playerid, h);
SetPlayerHealth(playerid, h + 25.0);
}
}
return 1;
}
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart)
{
if(weaponid == 24) // If the weapon is a deagle
{
new Float:health;
GetPlayerHealth(damagedid, health); // Get the player's health after the shot
health += amount; // Add the damage amount at the player's health
SetPlayerHealth(damagedid, health - 25); // Removed 1/4 of player's health
}
}