Ban Hammer

CosmG

Tree Puncher
#1
Use of this command: Tap the player you want to ban with the correct tool to ban them!
Why command was made: Someone requested it because they were tired of typing out player's full name
Remember To: Trigger it to damage trigger if haven't already (and unregister the command)
Give yourself the banhammer: /give <name> 275 1 {display:{Name:"§r§c§lBAN HAMMER"}}
Code:
cmd add banhammer let %id% = %args%[4]
cmd add banhammer if %id% != 1 then exit
cmd add banhammer let %killer% = %args%[3]
cmd add banhammer let %hand% = playerhand(%killer%)
cmd add banhammer if (%hand%["id"] != 275) or (%hand%["name"] != \"§r§c§lBAN HAMMER\") then exit
cmd add banhammer let %status% = playerstatus(%killer%)
cmd add banhammer if %status%["op"] = %true% then goto 10
cmd add banhammer message %killer% §cYou do not have permission to use the almighty §4§lBAN HAMMER! §7~CosG/CosmG
cmd add banhammer exit
cmd add banhammer let %gui%["type"] = \"modal\"
cmd add banhammer let %gui%["title"] = \"§cBAN HAMMER\"
cmd add banhammer let %gui%["content"] = \"Are you sure you want to ban §e\" + %p% + \"§f?\"
cmd add banhammer let %gui%["button1"] = \"§a§lYes\"
cmd add banhammer let %gui%["button2"] = \"§c§lNo\"
cmd add banhammer let %res% = dialog(%killer%, %gui%)
cmd add banhammer if %res% != %false% then goto 19
cmd add banhammer message %killer% §cBan request repealed!
cmd add banhammer exit
cmd add banhammer ascon /ban %p% §c§lBAN HAMMERED!
cmd add banhammer message onlineplayers() §8[§cCosGBAN§8] §7%p% §ejust received the §c§lBAN HAMMER§e! Justice has been served by §7%killer%!
cmd add banhammer exit
 
#3
I am not that good at Mad Commands but won’t you /ban yourself because it says this:

Ascon /ban %p%
look what this command does is
whenever you want to ban someone
you just need to hit the player with the item from the command(ban hammer)
then whoever got hit with that tool a menú will popup asking if you are sure about banning the plauer, they will get banned right away
 

CosmG

Tree Puncher
#4
I am not that good at Mad Commands but won’t you /ban yourself because it says this:

Ascon /ban %p%
No because it gets activated by the damage trigger. When a player get damaged, the damage trigger activates as the player getting damaged. In the cmd above /ban %killer% would ban urself