Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # =========================
- # Anti-Alt
- # Original by CombatMC
- # =========================
- # Config (edit it to however you like)
- options:
- reportBroadcastPermissions: "server.helper" or "server.mod" or "server.admin" or "server.owner"
- reportCommandPermissions: "server.admin" or "server.owner"
- messageNoPermission: &cYou are not allowed to use this command!
- messagePrefix: &7[&c&lAnti-Alt&7]
- # Codes (Do not edit)
- command /aa [<text>] [<offline player>]:
- trigger:
- if executor don't have permission {@reportCommandPermissions}:
- send "{@messagePrefix} {@messageNoPermission}" to executor
- stop
- if arg 1 or arg 2 is not set:
- send "{@messagePrefix} &cUsage: /aa <scan/remove> <player>%nl%{@messagePrefix} &6Scan: &cRescan player%nl%{@messagePrefix} &6Remove: &cRemove a player's anti-alt data" to executor
- stop
- if arg 1 is not "scan" or "remove":
- send "{@messagePrefix} &cUsage: /aa <scan/remove> <player>%nl%{@messagePrefix} &6Scan: &cRescan player%nl%{@messagePrefix} &6Remove: &cRemove a player's anti-alt data" to executor
- stop
- if arg 2 is not online:
- send "{@messagePrefix} &cError: %arg 2% is not online!" to executor
- stop
- if arg 1 is "scan":
- sendPlayerWithPermission("{@messagePrefix} &6%executor% &chas requested a anti-alt scan against player &6%arg 2%&c!")
- scanIp(arg 2, true)
- stop
- else if arg 1 is "remove":
- sendPlayerWithPermission("{@messagePrefix} &6%executor% &chas requested a anti-alt remove data for player &6%arg 2%&c!")
- set {_playerUuid} to "%{_player}'s UUID%"
- delete {lastLoggedIp::%{_playerUuid}%}
- delete {lastLoggedName::%{_playerUuid}%}
- stop
- on join:
- scanIp(player, false)
- function scanIp(player: player, bypass: boolean):
- registerIp({_player})
- set {_report} to getIpReport({_player}, {_bypass})
- if {_report} is not "none":
- sendPlayerWithPermission("{@messagePrefix} &f▂▂▂▂▂▂&6Anti-Alt Report&f▂▂▂▂▂▂%nl%{@messagePrefix} %{_report}%%nl%{@messagePrefix} %nl%{@messagePrefix} &7▉Offline &a▉Online%nl%{@messagePrefix} &f▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂")
- function registerIp(player: player):
- set {_playerUuid} to {_player}'s UUID
- set {lastLoggedIp::%{_playerUuid}%} to "%{_player}'s IP%"
- set {lastLoggedName::%{_playerUuid}%} to "%{_player}%"
- function getIpReport(target: player, bypass: boolean) :: text:
- loop {lastLoggedIp::*}:
- if {lastLoggedIp::%loop-index%} is equal to "%{_target}'s IP%":
- if "%{_target}'s UUID%" is not equal to "%loop-index%":
- if ("%{lastLoggedName::%loop-index%}%" parsed as player) is online:
- add "&a%{lastLoggedName::%loop-index%}%&f" to {_selectedPlayers::*}
- else:
- add "&7%{lastLoggedName::%loop-index%}%&f" to {_selectedPlayers::*}
- if {_selectedPlayers::*} is set:
- return "&fScanned User: &a%{_target}% &f(&a%{_target}'s IP%&f)%nl%{@messagePrefix} &fAccounts (&a%amount of {_selectedPlayers::*}%&f): &a%{_selectedPlayers::*}%"
- else if {_bypass} is true:
- return "&fScanned User: &a%{_target}% &f(&a%{_target}'s IP%&f)%nl%{@messagePrefix} &fAccounts (&a0&f): &cN/A"
- else:
- return "none"
- function sendPlayerWithPermission(message: text):
- loop all players:
- if loop-player has permission {@reportBroadcastPermissions}:
- send "%{_message}%" to loop-player
Add Comment
Please, Sign In to add comment