21.08.2011, 11:01
So basically I'm getting these warnings, I'd appreciate if somebody helped me, cause I strongly suspect this is something easy to be fixed..
Thanks.
Code:
if(gTeam[Shooter] == 2) { if(!pEnchanted) { new TargetName[MAX_PLAYER_NAME]; new ShooterName[MAX_PLAYER_NAME]; GetPlayerName(Target,TargetName,MAX_PLAYER_NAME); GetPlayerName(Shooter,ShooterName,MAX_PLAYER_NAME); new Float:health, Float:armour; GetPlayerHealth(Target,health); GetPlayerArmour(Target,armour); if(ArmourLost > 0.0) SetPlayerArmour(Target,floatadd(armour,ArmourLost)); if(HealthLost > 0.0) SetPlayerHealth(Target,floatadd(health,HealthLost)); new Damage; switch(GetPlayerWeapon(Shooter)) { //case [weaponid]: Damage = [damage]; case 0: Damage = 15; case 8: Damage = 20; case 4: Damage = 25; } armour = armour - Damage; if(armour < 0.0) { health += armour; //Health will decrease because armour is negative. (a + (-b) = a - b) if(health <= 0.0) { health = 0.0; } armour = 0.0; } SetPlayerHealth(Target, health); SetPlayerArmour(Target, armour); } return 1; } else { if(gTeam[Shooter] == 2) { if(pEnchanted == 1) { new TargetName[MAX_PLAYER_NAME]; new ShooterName[MAX_PLAYER_NAME]; GetPlayerName(Target,TargetName,MAX_PLAYER_NAME); GetPlayerName(Shooter,ShooterName,MAX_PLAYER_NAME); new Float:health, Float:armour; GetPlayerHealth(Target,health); GetPlayerArmour(Target,armour); if(ArmourLost > 0.0) SetPlayerArmour(Target,floatadd(armour,ArmourLost)); if(HealthLost > 0.0) SetPlayerHealth(Target,floatadd(health,HealthLost)); new Damage; switch(GetPlayerWeapon(Shooter)) { //case [weaponid]: Damage = [damage]; case 0: Damage = 15; case 8: Damage = 45; case 4: Damage = 25; } armour = armour - Damage; if(armour < 0.0) { health += armour; //Health will decrease because armour is negative. (a + (-b) = a - b) if(health <= 0.0) { health = 0.0; } armour = 0.0; } SetPlayerHealth(Target, health); SetPlayerArmour(Target, armour); } } } return 1;