29.08.2013, 15:30
Obrigado. Assim ta certo? Ta funcionando, mas sei lб pode ta meio errado pq ta dando warning ou pode ter um jeito melhor...
reputado!
Quote:
public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid) { new Float: vida, Float: armadura, Float: dmg; GetPlayerArmour(damagedid, armadura); GetPlayerHealth(damagedid, vida); if (armadura > 0) { if (amount > armadura) { dmg = amount - armadura; vida = vida - dmg; SetPlayerArmour(damagedid, 0.0); SetPlayerHealth(damagedid, vida); return 1; } armadura = armadura - amount; SetPlayerArmour(damagedid, armadura); } if (armadura < 1) { vida = vida - amount; SetPlayerHealth(damagedid, vida); } return 1; } public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid) { if(issuerid != INVALID_PLAYER_ID) // If not self-inflicted { new infoString[128], weaponName[24], victimName[MAX_PLAYER_NAME], attackerName[MAX_PLAYER_NAME]; GetPlayerName(playerid, victimName, sizeof (victimName)); GetPlayerName(issuerid, attackerName, sizeof (attackerName)); GetWeaponName(weaponid, weaponName, sizeof (weaponName)); //format(infoString, sizeof(infoString), "%s has made %.0f damage to %s, weapon: %s", attackerName, amount, victimName, weaponName); //SendClientMessageToAll(-1, infoString); } return 1; } |