4MaticPL

AuthSkript v.1.0

Nov 17th, 2013
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.61 KB | None | 0 0
  1. #AuthSkript
  2. #ver 1.0
  3. #create by 4MaticPL
  4.  
  5. #-----------------------------------------------------------------------------------
  6. options:
  7.     sk: &f[&9AuthSkript&f]
  8.     noperm: [AuthSkript]Nie masz do tego prawa :c
  9.     perm1: skript.authskript.unregister
  10. #-----------------------------------------------------------------------------------
  11. on quit:
  12.     if player is op:
  13.         wait 5 minutes
  14.         set {authskript.session.%player%} to none
  15. #-----------------------------------------------------------------------------------
  16. on join:
  17.     if player is op:
  18.         wait 6 tick
  19.         set {authskript.notlog.%player%} to 1
  20.         if {authskript.firstlogin.%player%} is not set:
  21.             set {authskript.firstlogin.%player%} to 1
  22.             set {back.%player%} to location of player
  23.             teleport player to the spawn point of "world"
  24.             set {authskript.notlog.%player%} to 1
  25.             send "{@sk}&cNie jestes zarejestrowany. Wpisz &4/register haslo haslo"
  26.             stop
  27.         else if {authskript.session.%player%} is {authskript.iplogin.%player%}:
  28.             set {authskript.notlog.%player%} to 0
  29.             teleport the player to {back.%player%}
  30.             send "{@sk}&6Witaj ponownie! Twoja sesja logowania została kontynuowanwa!"
  31.             stop
  32.         else if {authskript.notlog.%player%} is 1:
  33.             send "{@sk}&cNie jestes zalogowany. Wpisz &4/login haslo"
  34.             set {authskript.iplogin.%player%} to ip-address of the player
  35.             stop
  36. #-----------------------------------------------------------------------------------
  37. every 1 tick:
  38.     loop all players:
  39.         if {authskript.notlog.%loop-player%} is 1:
  40.             teleport loop-player to the spawn point of "world"
  41.  
  42. on command:
  43.     if player is op:
  44.         if {authskript.notlog.%player%} is 1:
  45.             command is not "register":
  46.                 command is not "login":
  47.                     if {authskript.firstlogin.%player%} is 1:
  48.                         send "{@sk}&cNie jestes zarejestrowany. Wpisz &4/register haslo haslo"
  49.                         cancel event
  50.                     else:
  51.                         send "{@sk}&cNie jestes zalogowany. Wpisz &4/login haslo"
  52.                         cancel event
  53.  
  54. on chat:
  55.     if player is op:
  56.         if {authskript.notlog.%player%} is 1:
  57.             if {authskript.firstlogin.%player%} is 1:
  58.                 send "{@sk}&cNie jestes zarejestrowany. Wpisz &4/register haslo haslo"
  59.                 cancel event
  60.             else:
  61.                 send "{@sk}&cNie jestes zalogowany. Wpisz &4/login haslo"
  62.                 cancel event
  63. #-----------------------------------------------------------------------------------
  64. command /register [<text>] [<text>]:
  65.     trigger:
  66.         if player is op:
  67.             if {authskript.firstlogin.%player%} is 1:
  68.                 if arg 1 is not empty:
  69.                     if arg 1 is arg 2:
  70.                         if {authskript.firstlogin.%player%} is 1:
  71.                             set {authskript.password.%player%} to hashed text-argument 1
  72.                             set {authskript.firstlogin.%player%} to 0
  73.                             set {authskript.notlog.%player%} to 0
  74.                             send "{@sk}&6Zostales pomyslnie zarejestrowany"
  75.                         else:
  76.                             send "{@sk}&cJestes juz zarejestrowany!"
  77.                             stop
  78.                     else:
  79.                         send "{@sk}&ePodane hasla nie sa takie same"
  80.                 else:
  81.                     send "{@sk}&cPodaj haslo"
  82.                     stop
  83.             else:
  84.                 send "{@sk}&eJestes juz zarejestrowany!"
  85.                 stop
  86. command /login [<text>]:
  87.     aliases: l
  88.     trigger:
  89.         if player is op:
  90.             if {authskript.notlog.%player%} is 0:  
  91.                 send "{@sk}&cJestes juz zalogowany!"
  92.             if {authskript.firstlogin.%player%} is 1:
  93.                 send "{@sk}&6Nie jestes zarejestrowany"
  94.             if hashed text-argument is {authskript.password.%player%}:
  95.                 set {authskript.session.%player%} to ip-address of the player
  96.                 teleport the player to {back.%player%}
  97.                 set {authskript.notlog.%player%} to 0
  98.                 send "{@sk}&6Zostales pomyslnie zalogowany"
  99.             else:
  100.                 send "{@sk}&6Podane haslo jest nieprawidlowe"
  101.  
  102. command /logout:
  103.     trigger:
  104.         if player is op:
  105.             set {back.%player%} to location of player
  106.             teleport player to the spawn point of "world"
  107.             set {authskript.notlog.%player%} to 1
  108.             send "{@sk}&6Zostales pomyslnie wylogowany!"
  109.  
  110. command /changepassword [<text>] [<text>]:
  111.     aliases: changepw, changpw
  112.     trigger:
  113.         if player is op:
  114.             if arg 1 is not set:
  115.                 send "{@sk}&cWpisz &4/changepw stare_haslo nowe_haslo"
  116.                 stop
  117.             if arg 2 is not set:
  118.                 send "{@sk}&cWpisz &4/changepw stare_haslo nowe_haslo"
  119.                 stop
  120.            
  121.             if arg 1 is {authskript.password.%player%}:
  122.                 set {authskript.password.%player%} to arg 2
  123.                 send "{@sk}&6Twoje haslo zostalo pomyslnie zmienione!"
  124.             else:
  125.                 send "{@sk}&cPodane haslo jest nieprawidlowe!"
  126.  
  127. command /unregister [<text>]:
  128.     permission: {@perm1}
  129.     permission message: {@noperm}
  130.     trigger:
  131.         if player is op:
  132.             set {authskript.firstlogin.%arg%} to 1
  133.             set {authskript.notlog.%arg%} to 1
  134.             send "{@sk}&6Gracz &2%arg% &6zostal pomyslnie odrejestrowany"
  135. #-----------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment