11.07.2011, 17:05
Presente
pawn Код:
public OnPlayerShootPlayer(Shooter,Target,Float:HealthLost,Float:ArmourLost)
{
//#define SHOOTSYSTEM_DEBUG
new Weapon = GetPlayerWeapon( Shooter ),
Float:Damage = 0; //Adicional. Ou Seja, isso mais o damage da prуpria arma
if( Weapon == 22 ) Damage = 28.0; // Colt .45
if( Weapon == 23 ) Damage = 35.0; // Silenced Colt .45
if( Weapon == 24 ) Damage = 20.0; // Deagle/Glock
if( Weapon == 25 ) Damage = 10.0; // Shotgun
if( Weapon == 27 ) Damage = 15.0; // SPAZ
if( Weapon == 28 ) Damage = 7.0; // UZI
if( Weapon == 29 ) Damage = 15.0; // MP5
if( Weapon == 30 ) Damage = 20.0; // AK
if( Weapon == 31 ) Damage = 15.0; // M4
if( Weapon == 32 ) Damage = 10.0; // Tec9
if( Weapon == 33 ) Damage = 50.0; // Country Rifle
if( Weapon == 34 ) Damage = 300.0; // Sniper
new Float:tArmour, Float:tHealth;
GetPlayerArmour( Target , tArmour );
GetPlayerHealth( Target , tHealth );
//--->
new Float:newColete;
newColete = tArmour - Damage;
if( newColete >= 0 ) SetPlayerArmour( Target , newColete );
else
{
SetPlayerArmour( Target, 0.0 );
//SetPlayerHealth( Target, newColete * (-1) );
SetPlayerHealth( Target, tHealth + newColete );
}
#if defined SHOOTSYSTEM_DEBUG
new str[180];
format( str , 180 , "[DEBUG] o ID %d atirou em no ID %d. Vida: %f para %f e Colete: %f para %f", Shooter, Target, HealthLost, vidaComDamageTirado, ArmourLost, coleteComDamageTirado );
SendClientMessageToAll( -1 , str );
format( str , 180 , "[DEBUG] Damage do Colete: %f. Da Vida: %f", Damage, (ArmourLost - coleteComDamageTirado) );
SendClientMessageToAll( -1 , str );
#endif
return 1;
}