Advertisement
Guest User

DarkRP name generator

a guest
Apr 3rd, 2011
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.78 KB | None | 0 0
  1. function meta:SetRPName(name, firstRun)
  2.     local lastnames = {
  3.         "Abbott",
  4.         "Andrews",
  5.         "Armstrong",
  6.         "Baker",
  7.         "Banks",
  8.         "Bennet",
  9.         "Brown",
  10.         "Burns",
  11.         "Caren",
  12.         "Carlson",
  13.         "Chapman",
  14.         "Clark",
  15.         "Clinton",
  16.         "Collins",
  17.         "Cook",
  18.         "Davis",
  19.         "Diez",
  20.         "Dunns",
  21.         "Ferguson",
  22.         "Fernandez",
  23.         "Fox",
  24.         "Frohman",
  25.         "Freeman",
  26.         "Finch",
  27.         "Gray",
  28.         "Griffin",
  29.         "Hill",
  30.         "Holmes",
  31.         "Hoffman",
  32.         "Miller",
  33.         "Jones",
  34.         "Johnson",
  35.         "King",
  36.         "Lee",
  37.         "Lewis",
  38.         "Lopez",
  39.         "Lewins",
  40.         "Martin",
  41.         "Moore",
  42.         "Morgan",
  43.         "Morris",
  44.         "Murphy",
  45.         "Nealson",
  46.         "Olson",
  47.         "Philips",
  48.         "Prince",
  49.         "Radley",
  50.         "Rodriguez",
  51.         "Russels",
  52.         "Sanders",
  53.         "Schmit",
  54.         "Smith",
  55.         "Stavale",
  56.         "Stein",
  57.         "Stuart",
  58.         "Tucker",
  59.         "Vance",
  60.         "Walker",
  61.         "Washington",
  62.         "Wells",
  63.         "White",
  64.         "Williams",
  65.         "Wilson",
  66.         "Young"
  67.     } //If you want more, add them!
  68.  
  69.     if name = "male" then
  70.         local firstnames = {
  71.             "Adam",
  72.             "Adrian",
  73.             "Albert",
  74.             "Alexander",
  75.             "Andrew",
  76.             "Arthur",
  77.             "Benjamin",
  78.             "Bradley",
  79.             "Brian",
  80.             "Caleb",
  81.             "Christopher",
  82.             "Derek",
  83.             "Dominic",
  84.             "Donald",
  85.             "Eric",
  86.             "Edward",
  87.             "Fred",
  88.             "George",
  89.             "Gordon",
  90.             "Guy",
  91.             "Harold",
  92.             "Harvey",
  93.             "Ian",
  94.             "Jay",
  95.             "Jack",
  96.             "James",
  97.             "Joel",
  98.             "Johnathan",
  99.             "Jordan",
  100.             "Juan",
  101.             "Justin",
  102.             "Kent",
  103.             "Kyle",
  104.             "Leon",
  105.             "Leonard",
  106.             "Lloyd",
  107.             "Logan",
  108.             "Lucas",
  109.             "Mark",
  110.             "Martin",
  111.             "Maxwell",
  112.             "Michael",
  113.             "Miles",
  114.             "Nathan",
  115.             "Neal",
  116.             "Nicolas",
  117.             "Owen",
  118.             "Patrick",
  119.             "Peter",
  120.             "Richard",
  121.             "Robert",
  122.             "Ronald",
  123.             "Scott",
  124.             "Sean",
  125.             "Seth",
  126.             "Stanley",
  127.             "Steven",
  128.             "Thomas",
  129.             "Timothy",
  130.             "Victor",
  131.             "Wallace",
  132.             "Wayne",
  133.             "Xavier"
  134.         } //If you want more, add them!
  135.  
  136.         name = table.Random(firstnames) .. " " .. table.Random(lastnames)
  137.     end
  138.    
  139.     if name = "female" then
  140.             local firstnames = {
  141.             "Abigail",
  142.             "Alexandria",
  143.             "Amanda",
  144.             "Ashley",
  145.             "Anna",
  146.             "Andrea",
  147.             "Audrey",
  148.             "Barbara",
  149.             "Beverly",
  150.             "Bonnie",
  151.             "Brooke",
  152.             "Caroline",
  153.             "Charlotte",
  154.             "Chris",
  155.             "Clair",
  156.             "Denise",
  157.             "Debra",
  158.             "Diane",
  159.             "Elizabeth",
  160.             "Ella",
  161.             "Emma",
  162.             "Emily",
  163.             "Eva",
  164.             "Faith",
  165.             "Gloria",
  166.             "Grace",
  167.             "Heather",
  168.             "Iris",
  169.             "Jasmine",
  170.             "Jean",
  171.             "Jennifer",
  172.             "Jessica",
  173.             "Joy",
  174.             "Juila",
  175.             "Katelyn",
  176.             "Kathrine",
  177.             "Kate",
  178.             "Karen",
  179.             "Kimberley",
  180.             "Lucy",
  181.             "Marilyn",
  182.             "Maria",
  183.             "Monica",
  184.             "Nina",
  185.             "Olivia",
  186.             "Patricia",
  187.             "Rachael",
  188.             "Rose",
  189.             "Samantha",
  190.             "Sarah",
  191.             "Shannon",
  192.             "Sophia",
  193.             "Stephanie",
  194.             "Tiffany",
  195.             "Victoria",
  196.             "Violet",
  197.             "Zoey"
  198.         } //If you want more, add them!
  199.  
  200.         name = table.Random(firstnames) .. " " .. table.Random(lastnames)
  201.     end
  202.    
  203.     -- Make sure nobody on this server already has this RP name
  204.     local lowername = string.lower(tostring(name))
  205.     DB.RetrieveRPNames(self, name, function(taken)
  206.         if string.len(lowername) < 2 and not firstrun then return end
  207.         -- If we found that this name exists for another player
  208.         if taken then
  209.             if firstRun then
  210.                 -- If we just connected and another player happens to be using our steam name as their RP name
  211.                 -- Put a 1 after our steam name
  212.                 DB.StoreRPName(self, name .. " 1")
  213.                 Notify(self, 0, 12, "Someone is already using your Steam name as their RP name so we gave you a '1' after your name.")
  214.             else
  215.                 Notify(self, 1, 5, string.format(LANGUAGE.unable, "RPname", "it's been taken"))
  216.                 return ""
  217.             end
  218.         else
  219.             if not firstRun then -- Don't save the steam name in the database
  220.                 NotifyAll(2, 6, string.format(LANGUAGE.rpname_changed, self:SteamName(), name))
  221.                 DB.StoreRPName(self, name)
  222.             end
  223.         end
  224.     end)
  225. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement