Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function meta:SetRPName(name, firstRun)
- local lastnames = {
- "Abbott",
- "Andrews",
- "Armstrong",
- "Baker",
- "Banks",
- "Bennet",
- "Brown",
- "Burns",
- "Caren",
- "Carlson",
- "Chapman",
- "Clark",
- "Clinton",
- "Collins",
- "Cook",
- "Davis",
- "Diez",
- "Dunns",
- "Ferguson",
- "Fernandez",
- "Fox",
- "Frohman",
- "Freeman",
- "Finch",
- "Gray",
- "Griffin",
- "Hill",
- "Holmes",
- "Hoffman",
- "Miller",
- "Jones",
- "Johnson",
- "King",
- "Lee",
- "Lewis",
- "Lopez",
- "Lewins",
- "Martin",
- "Moore",
- "Morgan",
- "Morris",
- "Murphy",
- "Nealson",
- "Olson",
- "Philips",
- "Prince",
- "Radley",
- "Rodriguez",
- "Russels",
- "Sanders",
- "Schmit",
- "Smith",
- "Stavale",
- "Stein",
- "Stuart",
- "Tucker",
- "Vance",
- "Walker",
- "Washington",
- "Wells",
- "White",
- "Williams",
- "Wilson",
- "Young"
- } //If you want more, add them!
- if name = "male" then
- local firstnames = {
- "Adam",
- "Adrian",
- "Albert",
- "Alexander",
- "Andrew",
- "Arthur",
- "Benjamin",
- "Bradley",
- "Brian",
- "Caleb",
- "Christopher",
- "Derek",
- "Dominic",
- "Donald",
- "Eric",
- "Edward",
- "Fred",
- "George",
- "Gordon",
- "Guy",
- "Harold",
- "Harvey",
- "Ian",
- "Jay",
- "Jack",
- "James",
- "Joel",
- "Johnathan",
- "Jordan",
- "Juan",
- "Justin",
- "Kent",
- "Kyle",
- "Leon",
- "Leonard",
- "Lloyd",
- "Logan",
- "Lucas",
- "Mark",
- "Martin",
- "Maxwell",
- "Michael",
- "Miles",
- "Nathan",
- "Neal",
- "Nicolas",
- "Owen",
- "Patrick",
- "Peter",
- "Richard",
- "Robert",
- "Ronald",
- "Scott",
- "Sean",
- "Seth",
- "Stanley",
- "Steven",
- "Thomas",
- "Timothy",
- "Victor",
- "Wallace",
- "Wayne",
- "Xavier"
- } //If you want more, add them!
- name = table.Random(firstnames) .. " " .. table.Random(lastnames)
- end
- if name = "female" then
- local firstnames = {
- "Abigail",
- "Alexandria",
- "Amanda",
- "Ashley",
- "Anna",
- "Andrea",
- "Audrey",
- "Barbara",
- "Beverly",
- "Bonnie",
- "Brooke",
- "Caroline",
- "Charlotte",
- "Chris",
- "Clair",
- "Denise",
- "Debra",
- "Diane",
- "Elizabeth",
- "Ella",
- "Emma",
- "Emily",
- "Eva",
- "Faith",
- "Gloria",
- "Grace",
- "Heather",
- "Iris",
- "Jasmine",
- "Jean",
- "Jennifer",
- "Jessica",
- "Joy",
- "Juila",
- "Katelyn",
- "Kathrine",
- "Kate",
- "Karen",
- "Kimberley",
- "Lucy",
- "Marilyn",
- "Maria",
- "Monica",
- "Nina",
- "Olivia",
- "Patricia",
- "Rachael",
- "Rose",
- "Samantha",
- "Sarah",
- "Shannon",
- "Sophia",
- "Stephanie",
- "Tiffany",
- "Victoria",
- "Violet",
- "Zoey"
- } //If you want more, add them!
- name = table.Random(firstnames) .. " " .. table.Random(lastnames)
- end
- -- Make sure nobody on this server already has this RP name
- local lowername = string.lower(tostring(name))
- DB.RetrieveRPNames(self, name, function(taken)
- if string.len(lowername) < 2 and not firstrun then return end
- -- If we found that this name exists for another player
- if taken then
- if firstRun then
- -- If we just connected and another player happens to be using our steam name as their RP name
- -- Put a 1 after our steam name
- DB.StoreRPName(self, name .. " 1")
- Notify(self, 0, 12, "Someone is already using your Steam name as their RP name so we gave you a '1' after your name.")
- else
- Notify(self, 1, 5, string.format(LANGUAGE.unable, "RPname", "it's been taken"))
- return ""
- end
- else
- if not firstRun then -- Don't save the steam name in the database
- NotifyAll(2, 6, string.format(LANGUAGE.rpname_changed, self:SteamName(), name))
- DB.StoreRPName(self, name)
- end
- end
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement