- ##############main.ms###############
- bind(player_join, null, null, @event, @server_name,
- tmsg(@event[player], '§4please login /lgi [pass] or register /rgp [pass]')
- if(equals(pinfo(@event['player'],3), get_value(@event['player'],'ip')),
- assign(@stval,@event['player'])
- store_value(@stval,'lgin', true)
- store_value(@stval,'lgintime', time())
- tmsg(@event[player], '§4Sesstion restored')
- )
- )
- bind(player_chat, null, null, @event,
- if(equals(get_value(@event['player'],'lgin'),false),
- msg('§cyou need to be logged in todo this')
- msg('§c/rgp [pass] to register pass')
- msg('§c/lgi [pass] to login')
- cancel()
- )
- )
- bind(player_command, null, null, @event,
- if(equals(get_value(@event['player'],'lgin'),false),
- assign(@ca,array('/lgi','/rgp'))
- if(not(array_contains(@ca,to_lower(@event['prefix']))),
- msg('§cyou need to be logged in todo this')
- msg('§c/rgp [pass] to register pass')
- msg('§c/lgi [pass] to login')
- cancel()
- )
- )
- )
- bind(player_interact, null, null, @event,
- if(equals(get_value(@event['player'],'lgin'),false),
- msg('§cyou need to be logged in todo this')
- msg('§c/rgp [pass] to register pass')
- msg('§c/lgi [pass] to login')
- cancel()
- )
- )
- bind(player_quit, null, null, @event,
- assign(@stval,@event['player'])
- store_value(@stval,'lgin', false)
- store_value(@stval,'lginatpmt', 0)
- store_value(@stval,'lgouttime', time())
- )
- #####config.txt####
- rgp:/rgp $pass = >>>
- if(has_value(player(),'pass'),
- msg('you already set up an account for this user /snp to set a new pass')
- die()
- )
- if(not(has_value(player(),'pass')),
- assign(@stval,player())
- store_value(@stval,'pass', $pass)
- store_value(@stval,'lgin', false)
- store_value(@stval,'ip', pinfo(player(),3))
- msg('§caccount registerd you can now login with /lgi [pass]')
- die()
- )
- <<<
- snp:/snp $pass = >>>
- if(equals(get_value(player(),'lgin'),true),
- assign(@stval,player())
- store_value(@stval,'pass', $pass)
- store_value(@stval,'lgin', false)
- msg('§cpassword reset you need to relogin now')
- die()
- )
- if(equals(get_value(player(),'lgin'),false),
- msg('§cyou need to log in todo this')
- die()
- )
- <<<
- lgi:/lgi $pass = >>>
- if(gte(get_value(player(),'lginatpmt'),5),
- assign(@stval,player())
- store_value(@stval,'lginatpmt', 0)
- store_value(@stval,'lgin', false)
- kick(player(),'Too many login attempts')
- die()
- )
- if(equals(get_value(player(),'pass'),$pass),
- assign(@stval,player())
- store_value(@stval,'lginatpmt', 0)
- store_value(@stval,'lgin', true)
- store_value(@stval,'ip', pinfo(player(),3))
- store_value(@stval,'lgintime', time())
- msg('§cyou are now logged in')
- die()
- )
- if(not(equals(get_value(player(),'pass'),$pass)),
- assign(@stval,player())
- if(not(has_value(player(),'lginatpmt')),
- store_value(@stval,'lginatpmt', 0)
- )
- assign(@stad,inc(get_value(@stval,'lginatpmt'),1))
- store_value(@stval,'lginatpmt', @stad)
- msg('§cincorrect pass')
- die()
- )
- #if(equals(get_value(player(),'lginatpmt'),4),
- #msg('§cincorrect pass you have one more try')
- #die()
- #)
- <<<
- lgo:/lgo $pass = >>>
- if(equals(get_value(player(),'pass'),$pass),
- assign(@stval,player())
- store_value(@stval,'lgin', false)
- store_value(@stval,'lginatpmt', 0)
- msg('§cyou are now logged out')
- store_value(@stval,'ip', pinfo(player(),3))
- die()
- )
- if(not(equals(get_value(player(),'pass'),$pass)),
- assign(@stval,player())
- store_value(@stval,'lginatpmt', 0)
- msg('§cincorrect pass')
- die()
- )
- <<<
- spp:/spp $player $pass = >>>
- if(array_contains(pgroup(player()), 'Admins'),
- assign(@stval,player($player))
- store_value(@stval,'pass', $pass)
- store_value(@stval,'lgin', false)
- store_value(@stval,'lginatpmt', 0)
- msg('§cpass setup for ' ,player($player), '')
- )
- <<<
- rsla:/rsla $player = >>>
- if(array_contains(pgroup(player()), 'Admins'),
- assign(@stval,player($player))
- store_value(@stval,'lginatpmt', 0)
- msg('§clogin attempts reset for ' ,player($player), '')
- )
- <<<