10-22-2012, 08:53 PM
Wrong! Wrong, wrong, wrong and wrong. And wrong once again.
(sorry, I'm just enjoying it)
There is cPlayer:GetName(), more than that - it works (look at playerlist in webadmin).
cPawn could be cPlayer and could NOT be a cPlayer as well. Use cEntity:GetEntityType() to check if you're dealing with player. There is some trick I can't remember now to get a cPlayer instance from your cPawn instance.
And sorry, but you have a way to check what's causing damage. It's inside TakeDamageInfo.
But I'm wondering if you actually want your not-logged-in players to be prevented from just making damage to other players and what for you want it that way. Could be much easier to cancel left-click with OnBlockDig hook.
(sorry, I'm just enjoying it)
There is cPlayer:GetName(), more than that - it works (look at playerlist in webadmin).
cPawn could be cPlayer and could NOT be a cPlayer as well. Use cEntity:GetEntityType() to check if you're dealing with player. There is some trick I can't remember now to get a cPlayer instance from your cPawn instance.
And sorry, but you have a way to check what's causing damage. It's inside TakeDamageInfo.
But I'm wondering if you actually want your not-logged-in players to be prevented from just making damage to other players and what for you want it that way. Could be much easier to cancel left-click with OnBlockDig hook.