Get player by name
#5
I believe we are very near Blush
function OnProjectileHitEntity(ProjectileEntity, Entity)
 ShooterName = ProjectileEntity:GetCreatorName()
 --Entity:TakeDamage(DamageType, AttackerEntity, RawDamage, KnockbackAmount)
  Entity:GetWorld():DoWithPlayer(ShooterName,
    function(a_Player)
        Entity:TakeDamage(dtArrow, a_Player, 18, ProjectileEntity:GetPosition())
    end
)
end

but

Quote:[18:23:02] LUA: Plugins/Sniper/main.lua~:88: error in function 'TakeDamage'.
argument #2 is 'number'; 'cEntity' expected.

[18:23:02] Stack trace:
[18:23:02] [C](-1): TakeDamage
[18:23:02] Plugins/Sniper/main.lua~(88): (no name)
[18:23:02] [C](-1): DoWithPlayer
[18:23:02] Plugins/Sniper/main.lua~(86): (no name)
[18:23:02] Stack trace end
[18:23:02] Error in <attached> calling function <callback>()
[18:23:02] LUA: Plugins/Sniper/main.lua~:88: error in function 'TakeDamage'.
argument #2 is 'number'; 'cEntity' expected.

[18:23:02] Stack trace:
[18:23:02] [C](-1): TakeDamage
[18:23:02] Plugins/Sniper/main.lua~(88): (no name)
[18:23:02] [C](-1): DoWithPlayer
[18:23:02] Plugins/Sniper/main.lua~(86): (no name)
[18:23:02] Stack trace end
[18:23:02] Error in <attached> calling function <callback>()

What do I wrong?
Reply
Thanks given by:


Messages In This Thread
Get player by name - by JuliB - 01-08-2016, 02:40 AM
RE: Get player by name - by NiLSPACE - 01-08-2016, 02:48 AM
RE: Get player by name - by JuliB - 01-08-2016, 03:06 AM
RE: Get player by name - by NiLSPACE - 01-08-2016, 03:13 AM
RE: Get player by name - by JuliB - 01-08-2016, 03:25 AM
RE: Get player by name - by NiLSPACE - 01-08-2016, 03:35 AM
RE: Get player by name - by JuliB - 01-08-2016, 03:50 AM
RE: Get player by name - by xoft - 01-08-2016, 07:55 AM
RE: Get player by name - by NiLSPACE - 01-08-2016, 05:45 PM
RE: Get player by name - by xoft - 01-08-2016, 11:44 PM
RE: Get player by name - by NiLSPACE - 01-09-2016, 12:03 AM



Users browsing this thread: 3 Guest(s)