Help me [+REP]
#5

Quote:
Originally Posted by jlalt
Посмотреть сообщение
You have to make custom damage system for your server, I think the below codes have to do the job for you...

PHP код:
public OnPlayerGiveDamage(playeriddamagedidFloatamountweaponidbodypart)
{
   if(
IsPlayerConnected(playerid) && IsPlayerConnected(damagedid)) {
      new 
Float:Health,Float:Armour;
      
GetPlayerArmour(damagedidArmour);
      if(
Armour 0.0)
      {
         
SetPlayerArmour(damagedidArmour+amount);
      }
      else
      {
         
GetPlayerHealth(damagedidHealth);
         
SetPlayerHealth(damagedidHealth+amount);
      }
      if(
GetPlayerWeapon(playerid) == /* weapon id you want here */)
      {
         
GivePlayerDamage(damagedid15.0);
      }
   }
}
GivePlayerDamage(playeridFloat:Amount) {
   new 
Float:Health,Float:ArmourFloat:checker;
   
GetPlayerArmour(playeridArmour);
   
GetPlayerHealth(playeridHealth);
   if(
Armour 0.0)
   {
      
checker Armour-Amount;
      if(
checker 0.0)
      {
         
SetPlayerArmour(playerid0);
         
SetPlayerHealth(playeridHealth-checker);
      }
      else
      {
         
SetPlayerArmour(playeridchecker);
      }
   }
   else
   {
      
checker Health-Amount;
      
SetPlayerHealth(playeridchecker);
   }
   

I'm pretty sure that will cause bugs.

https://sampforum.blast.hk/showthread.php?tid=563387
Reply


Messages In This Thread
Help me [+REP] - by XStreeter - 08.07.2016, 16:30
Re: Help me [+REP] - by XStreeter - 08.07.2016, 17:29
Re: Help me [+REP] - by Mencent - 08.07.2016, 17:54
Re: Help me [+REP] - by jlalt - 08.07.2016, 18:08
Re: Help me [+REP] - by SickAttack - 08.07.2016, 18:14

Forum Jump:


Users browsing this thread: 2 Guest(s)