Garry's Mod

Garry's Mod

[E2] DamageCore
Sir Papate  [开发者] 2014 年 1 月 16 日 下午 7:58
Documentation
Functions
Domage Type Enumerations

Function Return Description runOnDmg(N) runOnDmg(N,E) runOnDmg(N,R) E:trackDamage() E:stopTrackDamage() damage() DMG Retruns an empty damage. dmgClk() N Retruns the clk. lastDamage() DMG Retruns the last damage. lastDamageVictim() E Returns the last victim.
Function Return Description DMG:getDamage() N Returns damage. DMG:getAttacker() E Returns the attacker of damage. DMG:getForce() V Returns a vector representing the damage force. DMG:getPosition() V Returns the position where the damage was or is going to be applied to. DMG:getType() N Returns a bitflag which indicates the damage type of the damage. DMG:getInflictor() E Returns the inflictor of the damage. This is not necessarily a weapon. DMG:isBulletDamage() N Returns 1 if the damage was caused by a bullet. DMG:isExplosionDamage() N Returns 1 if the damage contains explosion damage. DMG:isFallDamage() N Returns 1 if the damage contains fall damage. DMG:setDamage(N) Sets the amount of damage. DMG:setAttacker(E) Sets the attacker of the damage. DMG:setForce(V) Sets the directional force of the damage. DMG:setPosition(V) Sets the position of where the damage gets applied to. DMG:setType(N) Sets the damage type. DMG:setInflictor(E) Sets the inflictor of the damage for example a weapon.
Function Description E:takeDamage(DMG) Applies the damage specified by the damage info to the entity. E:takeDamage(N) Applies the specified amount of damage to the entity. (Damage) E:takeDamage(N,E) Applies the specified amount of damage to the entity. (Dmage, Attacker) E:takeDamage(N,E,E) Applies the specified amount of damage to the entity. (Dmage, Attacker, Inflector) blastDamage(DMG,V,N) Applies spherical damage based on damage info to all entities in the specified radius. (Damage, Position, Radius) blastDamage(E,E,V,N,N) Applies explosion damage to all entities in the specified radius. (Attacker, Inflector, Position, Radious, damage)

Old Functions, but still working.
Function Description E:dmgApplyDamage(N) Applies the damage specified by the damage info to the player.
Function Return Description dmgDamage() N Returns the total damage. dmgVictim() E Return the entity taking damage. dmgAttacker() E Returns the attacker for example a player that shot the weapon. dmgInflictor() E Returns the inflictor of the This is not necessarily is a weapon. dmgPos() V Returns the position where the damage was or is going to be applied to. dmgForce() V Returns a vector representing the damage force. dmgType() S Returns type of the damage.

For the PlayerCore WorkShop, click here.
For the WeaponCore WorkShop, click here.
最后由 Sir Papate 编辑于; 2016 年 10 月 22 日 下午 3:30
< >
正在显示第 1 - 15 条,共 18 条留言
OUIIJM GUIITPS 2015 年 12 月 5 日 下午 7:12 
What do you mean specified by the damage info?

like

owner():dmgApplyDamage(10000)
does not work
>me bee 2016 年 1 月 29 日 下午 7:28 
The "dmgApplyDamage" does not work, it always throws an error everytime I want to apply damage to a player entity, and apparently it's in the script for the extension.
OUIIJM GUIITPS 2016 年 1 月 30 日 下午 10:18 
引用自 Mudkip
The "dmgApplyDamage" does not work, it always throws an error everytime I want to apply damage to a player entity, and apparently it's in the script for the extension.
Indeed. There was a way to use it, i just forgot how ill keep you updated if i find it
>me bee 2016 年 1 月 31 日 上午 9:07 
i just forgot how ill keep you updated if i find it

What do you mean by that
I get notifications if there are new comments here
最后由 >me bee 编辑于; 2016 年 1 月 31 日 上午 9:07
OUIIJM GUIITPS 2016 年 1 月 31 日 上午 11:57 
引用自 Mudkip
i just forgot how ill keep you updated if i find it

What do you mean by that
I get notifications if there are new comments here
Yeah ill say here if i figure it out
BaboucheOne 2016 年 10 月 22 日 下午 3:25 
引用自 Mudkip
The "dmgApplyDamage" does not work, it always throws an error everytime I want to apply damage to a player entity, and apparently it's in the script for the extension.

Try to indicate if the entity target is valid.

if(Ent:isValid())
{
//Code
}
Sanders 2017 年 2 月 22 日 下午 4:23 
in trying to do this if(Power & ONN:count() != 0){ONN[1,entity]:dmgApplyDamage(2000)}
L=holoEntity(1):getConstraints() but when i wanna have an input of like L or anything it does not wanna go valid nor will it work
BaboucheOne 2017 年 2 月 24 日 上午 8:49 
in trying to do this if(Power & ONN:count() != 0){ONN[1,entity]:dmgApplyDamage(2000)}
L=holoEntity(1):getConstraints() but when i wanna have an input of like L or anything it does not wanna go valid nor will it work


Hi,

You cannot put constraints on holoEntitys that why it does an error !
I hope this is your problem because I do not realy understand you question...

bye :O
Sanders 2017 年 2 月 25 日 上午 2:18 
im trying to get it so what ever the holo is parented to it will damage it (if its npc or plyer) i know it wouldnt damage a prop
Sanders 2017 年 3 月 6 日 下午 6:28 
引用自 Alexwall"quit
What do you mean specified by the damage info?

like

owner():dmgApplyDamage(10000)
does not work

lol that does work i tested it just today
StonerRabbit 2017 年 9 月 14 日 下午 4:13 
引用自 Alexwall"quit
What do you mean specified by the damage info?

like

owner():dmgApplyDamage(10000)
does not work

lol that does work i tested it just today


引用自 BaboucheOne
引用自 Mudkip
The "dmgApplyDamage" does not work, it always throws an error everytime I want to apply damage to a player entity, and apparently it's in the script for the extension.

Try to indicate if the entity target is valid.

if(Ent:isValid())
{
//Code
}

This is probably because of the prop protection :P
>me bee 2017 年 9 月 15 日 上午 1:24 
apart from being late for several months, how can prop protection interfere with a player entity?
BaboucheOne 2017 年 9 月 16 日 上午 6:42 
引用自 Undeadhero

lol that does work i tested it just today


引用自 BaboucheOne

Try to indicate if the entity target is valid.

if(Ent:isValid())
{
//Code
}

This is probably because of the prop protection :P

[If I remenber well the conversation]
Not because of the props protection because I'm admin, more because most of time people apply dmg on player and after add some params to this player, but... the player is dead then cannot ! because the variable is set to "null" so we put a 'isValid'
Seleramis 2019 年 7 月 24 日 上午 6:18 
I want to get the amount of damage an entity has taken. I tried DMG:getDamage() but it's not working.
最后由 Seleramis 编辑于; 2019 年 7 月 24 日 上午 6:24
>me bee 2019 年 7 月 24 日 上午 10:53 
First off, you could've made a new thread rather than necro a 2-to-3 year old thread.
< >
正在显示第 1 - 15 条,共 18 条留言
每页显示数: 1530 50