Hi, Im working on making a warn command for my server, it works great except for being able to clear a specific player's warns. It won't work properly and I'm having trouble figuring it out.
Code:
command /warn [<player>] [<text>] [<player>]:
permission: warn.use
trigger:
if arg-1 and arg-2 is set:
if arg-1 is online:
add arg-2 to {warn::*}
set {warns.%text-argument%} to player argument 1
send "&8[&aNatalciuu&8] &7You have been warned by &e%player% &7for reason &e%arg-2%" to arg-1
send "&8[&aNatalciuu&8] &7You warned &e%arg-1% &7for reason &e%arg-2%" to player
loop all players:
if loop-player has permission "warn.use":
send "&eWarn: &7from %player%" to loop-player
send "&eWarned: &7%arg-1%" to loop-player
send "&eReason: &7%arg-2%" to loop-player
else if arg-2 is not set:
send "&8[&aNatalciuu&8] &7Please put in a reason."
else if arg-1 is not set:
if arg-2 is "clear":
if arg-3 is set:
loop {warn::*}:
if loop-value is arg-3:
remove arg-3 from {warn::*}
send "&8[&aNatalciuu&8] &7Cleared player &e%arg-3%&e's &7warns"
exit loop
if arg-2 is "list":
send "&e&l&nNatalciuu Warns"
send " "
loop {warn::*}:
set {warn} to {numara}
send "&ePlayer: &7%{warns.%loop-value%}%"
send "&eReason: &7%loop-value%"
send " "