23.12.2012, 22:50
(
Последний раз редактировалось NuTShoT; 26.01.2013 в 22:54.
)
@RESOLVIDO +rep A TODOS
amount = amount/2;
public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid)
{
new Float:Life, Float:Coleete, Float:Dano;
GetPlayerArmour(damagedid, Coleete);
GetPlayerHealth(damagedid, Life);
if(Coleete > 0)
{
if(amount > Coleete)
{
Dano = amount - Coleete;
Life = Life - Dano;
SetPlayerArmour(damagedid, 0.0);
SetPlayerHealth(damagedid, Life);
return 1;
}
Coleete = Coleete - amount;
SetPlayerArmour(damagedid, Coleete);
}
if(Coleete < 1)
{
Life = Life - amount;
SetPlayerHealth(damagedid, Life);
}
if(damagedid == INVALID_PLAYER_ID) return true;
if(IsPlayerInAnyVehicle(playerid) && !IsPlayerInAnyVehicle(damagedid))
{
SendClientMessage(playerid, COR_PR, "Nгo podes atirar de seu veiculo!");
RemovePlayerFromVehicle(playerid);
return false;
}
return true;
}
|
use a public OnPlayerTakeDamage e faz para detectar quando o cara perde life com a tal arma, tire mais sangue !
|
if(issuerid != INVALID_PLAYER_ID)
{
new Float:health;
GetPlayerHealth(playerid, health);
if(weaponid == 7)
SetPlayerHealth(playerid,health-12);
if(weaponid == 8)
SetPlayerHealth(playerid,health-90);
if(weaponid == 4)
SetPlayerHealth(playerid,health-78);
if(weaponid == 3)
SetPlayerHealth(playerid,health-11);
if(weaponid == 5)
SetPlayerHealth(playerid,health-11);
if(weaponid == 23)
SetPlayerHealth(playerid,health-53);
if(weaponid == 24)
SetPlayerHealth(playerid,health-30);
if(weaponid == 22)
SetPlayerHealth(playerid,health-39);
if(weaponid == 25)
SetPlayerHealth(playerid,health-65);
if(weaponid == 26)
SetPlayerHealth(playerid,health-48);
if(weaponid == 27)
SetPlayerHealth(playerid,health-32);
if(weaponid == 28)
SetPlayerHealth(playerid,health-28);
if(weaponid == 29)
SetPlayerHealth(playerid,health-31);
if(weaponid == 30)
SetPlayerHealth(playerid,health-41);
if(weaponid == 31)
SetPlayerHealth(playerid,health-41);
if(weaponid == 32)
SetPlayerHealth(playerid,health-27);
if(weaponid == 33)
SetPlayerHealth(playerid,health-97);
if(weaponid == 34)
SetPlayerHealth(playerid,health-213);
if(weaponid == 33)
SetPlayerHealth(playerid,health-97);
if(weaponid == 33) SetPlayerHealth(playerid,health-97);
}