Creating a Damage Ban Command | NEED HELP
Hi! I am trying to make a SAM admin mod command that will stop a player from doing any damage to others when they are "damaged banned", this is the code that I have so far. The command itself works, but I am stuck on how to actually stop the player from doing damage, I believe I got the hook correct but it does not work. Any support would go a long way, Thanks!
--- THIS IS THE PART THAT I BELIEVE NEEDS FIXING TO ACTUALLY WORK ---
--- THIS IS THE PART THAT I BELIEVE NEEDS FIXING TO ACTUALLY WORK ---
you should be getting an error.
but you should also refactor your approach to this, seems like a very flawed nonsensical approach.
if i were you i'd go for something like:
sam_damage_bans = sam_damage_bans or {}
-- add damage ban
sam_damage_bans[player_steamid] = CurTime() + duration
-- playershoudltakedamage
if sam_damage_bans[player_steamid] and sam_damage_bans[player_steamid] > CurTime() then
return false
end
just a little something for you to think about ig, makes it far easier to work with
Hi! Thanks for replying. I see what your trying to do but how would the undmgban command work, and secondly how would Iadd a player to the list in the dmgban command. Thanks.