Advertisement
PSquishyP

Untitled

Nov 8th, 2015
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.95 KB | None | 0 0
  1. local function error(reason, blacklist?)
  2.     --[[ error messages
  3. 1 - Generic Internal Error
  4. 2 - Incorrect Computer ID (how idk)
  5. 3 - Incorrect IP Address (how idk)
  6. 4 - Incorrect Password
  7. 404 - I Don't Know What Happened
  8. ]]
  9.     if reason == 1 then
  10.         errorReason = "Generic Internal Error"
  11.         rednet.broadcast(errorReason, serverIp)
  12.         print(errorReason)
  13.     elseif reason == 2 then
  14.         if blacklist? == true then
  15.             print("wat")
  16.             errorReason = "Incorrect Computer ID. The client ".. clientIP .." with ID ".. clientID .." has been blacklisted"
  17.             rednet.broadcast(errorReason, serverIp)
  18.             print(errorReason)
  19.         else
  20.             errorReason = "Incorrect Computer ID."
  21.             rednet.broadcast(errorReason, serverIp")
  22.            print(errorReason)
  23.        end
  24.    elseif reason == 3 then
  25.        if blacklist? == true then
  26.            print("wat")
  27.            errorReason = "Incorrect Computer IP Address. The client ".. clientIP .." with ID ".. clientID .." has been blacklisted"
  28.            rednet.broadcast(errorReason, serverIp)
  29.            print(errorReason)
  30.        else
  31.            errorReason = "Incorrect Computer IP."
  32.            rednet.broadcast(errorReason, serverIp")
  33.             print(errorReason)
  34.         end
  35.     elseif reason == 4 then
  36.         if blacklist? == true then
  37.             print("wat")
  38.             errorReason = "Incorrect Password. The client ".. clientIP .." with ID ".. clientID .." has been blacklisted"
  39.             rednet.broadcast(errorReason, serverIp)
  40.             print(errorReason)
  41.         else
  42.             errorReason = "Incorrect Password."
  43.             rednet.broadcast(errorReason, serverIp")
  44.            print(errorReason)
  45.        end
  46.    else
  47.        errorReason = "I just don't know what happened."
  48.        rednet.broadcast(errorReason, serverIp")
  49.        print(errorReason)
  50.    end
  51. end
  52. end
  53. end
  54. end
  55. end
  56.  
  57. --why does it need 4 extra ends...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement