Hey so I need help making a staff authentication skript names easyauth.
My code so far is this:
Scroll to the bottom cause that's where my issues are.. The entire PIN system works great and all but I'm just having issues with IPS..
Feel free to spoon feed me cause this is only like my 4th skript.
Regards, DroppingYou
[doublepost=1511423845,1511423594][/doublepost]reading this over I realize I have not stated my issue... Silly me
Basically I want it to not allow players to join on a different IP of their origin IP (from first time join/ first time pin setting) but I'm not familiar enough with the conditions, and effects of skripts low end documentation given to understand what to do with IPS. Ive tried to look at other skripts for methods on obtaining a players IP and I cant find anything. Any help would be great
My code so far is this:
code_language.skript:
#--------------- Staff Auth --------------#
# NORMAL PIN AUTHENTICATION #
on join:
if player has permission "staffauth.staff":
if {password.%player%} is not set:
message "&7Since this is your first time joining as staff, please use &c&l/REGISTER <PIN> <CONFIRM PIN> &7to protect your account."
on quit:
set {loggedin.%player%} to false
on disconnect:
set {loggedin.%player%} to false
on any movement:
if player has permission "easyauth.staff":
if {loggedin.%player%} is false:
cancel event
message "&7In order to play, you must login using &c&l/LOGIN <PIN>"
if {loggedin.%player%} is true:
stop
if {pin.%player%} is not set:
cancel event
message "&7Please use &c&l/REGISTER <PIN> <CONFIRM PIN> &7before playing"
command /register [<text>] [<text>]:
permission: easyauth.staff
trigger:
if {pin.%player%} is set:
message "&c&lERROR! &7You already have a pin set! To change your pin use &c&l/RESETPIN <OLD-PIN> <NEW-PIN>"
else:
if arg 1 is set:
if arg 2 is set:
if arg 1 = arg 2:
set {pin.%player%} to arg 1
message "&7Thank you for registering. Your PIN is &c&l%arg 1%"
else:
message "&7Wrong usage. Please use &c&l/REGISTER <PIN> <CONFIRM PIN>"
else:
message "&7Wrong usage. Please use &c&l/REGISTER <PIN> <CONFIRM PIN>"
command /login [<text>]:
permission: easyauth.staff
trigger:
if arg 1 is not set:
message "&7Please use &c&l/LOGIN <PIN>"
if arg 1 is {pin.%player%}:
set {loggedin.%player%} to true
message "&a&lSUCCESSFULLY &7logged in."
if arg 1 is not {pin.%player%}:
loop 5 times:
message "&4&lINCORRECT PIN!"
command /resetpin [<text>] [<text>]:
permission: easyauth.staff
trigger:
if arg 1 is {pin.%player%}:
if arg 2 is set:
set {pin.%player%} to arg 2
message "&7Your PIN has sucessfully been reset. Your new PIN is &c&l%arg 2%"
else:
message "&7Now enter a &c&lNEW PIN"
else:
message "&7Wrong usage. Please enter your &c&lOLD PIN"
# IP AUTHENTICATION #
on join:
if player has permission "easyauth.staff":
if {pin.%player%} is not set:
set {ip.%player%} to player's ip
on any movement:
if player has permission "easyauth.staff":
if players ip is not {ip.%player%}:
wait 20 ticks
kick due to "&c&lInvalid IP &4&l>> &c&lPlease alert admins through discord to reset your IP!"
if {ip.%player%} is not set:
set {ip.%player%} to players ip
Scroll to the bottom cause that's where my issues are.. The entire PIN system works great and all but I'm just having issues with IPS..
Feel free to spoon feed me cause this is only like my 4th skript.
Regards, DroppingYou
[doublepost=1511423845,1511423594][/doublepost]reading this over I realize I have not stated my issue... Silly me
Basically I want it to not allow players to join on a different IP of their origin IP (from first time join/ first time pin setting) but I'm not familiar enough with the conditions, and effects of skripts low end documentation given to understand what to do with IPS. Ive tried to look at other skripts for methods on obtaining a players IP and I cant find anything. Any help would be great