OnPlayerDamage
From Onset Developer Wiki
Description
Event thats called when player receives damage.
Syntax
OnPlayerDamage(player, damagetype, amount)
Parameters
- player
The player who is being damaged. - damagetype
Type of damage applied. - amount
Amount of damage applied.
Example
function OnPlayerDamage(player, damagetype, amount)
local DamageName = {
"Weapon",
"Explosion",
"Fire",
"Fall",
"Vehicle Collision"
}
print(GetPlayerName(player).."("..player..") took "..amount.." damage of type "..DamageName[damagetype])
end
AddEvent("OnPlayerDamage", OnPlayerDamage)
See also
- OnPlayerServerAuth
- OnPlayerSteamAuth
- OnPlayerStreamIn
- OnPlayerStreamOut
- OnPlayerJoin
- OnPlayerQuit
- OnPlayerSpawn
- OnPlayerDeath
- OnPlayerWeaponShot
- OnPlayerDamage
- OnPlayerChat
- OnPlayerChatCommand
- OnPlayerInteractDoor
- OnPlayWeaponHitEffects
- OnPlayerSwitchCamera
- OnPlayerEnterWater
- OnPlayerLeaveWater
- OnPlayerCrouch
- OnPlayerEndCrouch
- OnPlayerEndFall
- OnPlayerFall
- OnPlayerTalking