• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Ayuda] Damage System
#2
Heart 
Puedes utilizar este codigo en caso de que quieras definir el da?o de varias armas recuerda que
el uso de switches es mucho mas optimo que usar varios "if s"



Quote:public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
? ? switch(weaponid)
? ? {
? ? ? ? case 0: SetPlayerHealth(playerid, -5);//Cada case seria el WeaponID SetPlayerHealth(playerid,-5); en este caso el pu?o te bajar?a -5 de vida
? ? ? ? case 26: SetPlayerHealth(playerid, -60);//lo mismo pero con la "Sawnoff Shotgun"
}

}

O tambien puedes utilizar esto codigo ?nicamente?para la escopeta o otra arma?


Quote:public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)

if(issuerid != INVALID_PLAYER_ID && weaponid == 26)? ? //Weaponid es el id de la arma

? ? {

? ? SetPlayerHealth(playerid, -60);//Lo mismo del codigo anterior?

? ?
? ? }
  Reply


Messages In This Thread
[Ayuda] Damage System - by icecoldkangaroo12 - 2021-05-29, 03:32 AM
RE: [Ayuda] Damage System - by ImFlanny - 2021-05-29, 03:48 AM
RE: [Ayuda] Damage System - by icecoldkangaroo12 - 2021-05-29, 04:12 AM
RE: [Ayuda] Damage System - by ImFlanny - 2021-05-29, 03:36 PM
RE: [Ayuda] Damage System - by Pinch - 2021-05-29, 11:28 AM
RE: [Ayuda] Damage System - by icecoldkangaroo12 - 2021-05-29, 11:49 PM
RE: [Ayuda] Damage System - by xbruno1000x - 2021-06-02, 07:24 PM
RE: [Ayuda] Damage System - by icecoldkangaroo12 - 2021-06-03, 03:35 AM

Forum Jump: