Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- addCommandHandler ( "register", function ( player, command, arg1, arg2 )
- local username = getPlayerName ( player )
- local password = arg1
- if ( arg2 ) then
- username = arg1
- password = arg2
- end
- if ( password ~= nil ) then
- if ( string.len ( password ) < 4 ) then
- outputChatBox ( "register: - Password should be at least 4 characters long", player, 255, 100, 70 )
- elseif ( addAccount ( username, password ) ) then
- outputChatBox ( "You have successfully registered! Username: '"..username.."', Password: '"..password.."'(Remember it)", player, 255, 100, 70 )
- outputServerLog ( "ADMIN: "..getPlayerName ( player ).." registered account '"..username.."' (IP: "..getPlayerIP(player).." Serial: "..getPlayerSerial(player)..")" )
- elseif ( getAccount ( username ) ) then
- outputChatBox ( "register: - Account with this name already exists.", player, 255, 100, 70 )
- else
- outputChatBox ( "Unknown Error", player, 255, 100, 70 )
- end
- else
- outputChatBox ( "register: - Syntax is 'register [<nick>] <password>'", player, 255, 100, 70 )
- end
- end )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement