How to give damage?
#1

I want to give 90 dmg when i launch anthrax,how can we give dmg to a player?
Reply
#2

https://sampwiki.blast.hk/wiki/OnPlayerGiveDamage
Reply
#3

Use SetPlayerHealth to set a player's health, if you wan't to apply damage, use GetPlayerHealth.
pawn Код:
new Float:health; // Creates a float called "health"
GetPlayerHealth(playerid, health); // Stores the player's health in the float "health"
SetPlayerHealth(playerid, health - 90); // Sets the player's health to the float "health" - 90
There are several callbacks where you can detect if the player damages another player, like OnPlayerTakeDamage and OnPlayerGiveDamage.
Reply
#4

Quote:
Originally Posted by CalvinC
Посмотреть сообщение
Use SetPlayerHealth to set a player's health, if you wan't to apply damage, use GetPlayerHealth.
pawn Код:
new Float:health; // Creates a float called "health"
GetPlayerHealth(playerid, health); // Stores the player's health in the float "health"
SetPlayerHealth(playerid, health - 90); // Sets the player's health to the float "health" - 90
There are several callbacks where you can detect if the player damages another player, like OnPlayerTakeDamage and OnPlayerGiveDamage.
Код:
SetPlayerHealth(playerid, health - 90.0);
Reply
#5

Quote:
Originally Posted by JaydenJason
Посмотреть сообщение
Код:
SetPlayerHealth(playerid, health - 90.0);
There's no difference of 90 or 90.0.
Reply
#6

Quote:
Originally Posted by JaydenJason
Посмотреть сообщение
Код:
SetPlayerHealth(playerid, health - 90.0);
lol both works, there's no difference like he said
Reply
#7

Yeah ty that worked
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)