Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Replace Player Names v2 for Phasor v2+
- -- by H® Shaft
- -- This will replace "unwanted names" (line 47) with the "replacement_names" you specify (line 54) and also, notify the player.
- -- You can add names to the table: (replace_table) with the name you want replaced in quotes separated by comma between names.
- -- all names are case sensitive: "Smith" is not the same as "smith" - so bad strings can be added to catch multiple names (line 69)
- -- This script is a derivation/development of my original Replace Player Names v1 and OnNameRequest by Devieth/IT300/Skylace,
- -- Message given to player who had their name replaced and tells them their new name:
- REPLACEMENT_MESSAGE = "The server has replaced your name. Your new name is: "
- -- don't edit --
- newnames = {}
- function GetRequiredVersion()
- return 200
- end
- function OnScriptLoad(process, game, persistent)
- for i=0,15 do
- if getplayer(i) then
- newnames[gethash(i)] = false
- end
- end
- end
- function OnPlayerJoin(player)
- if getplayer(player) then
- if newnames[gethash(player)] then
- sendresponse(REPLACEMENT_MESSAGE .. getname(player), player)
- end
- end
- end
- function OnPlayerLeave(player)
- if getplayer(player) then
- newnames[gethash(player)] = nil
- end
- end
- function OnNameRequest(hash, name, new_name)
- -- UTF8 character code for '%+%'
- autogen = "\43\37\43"
- -- unwanted names: case sensitive ("Bob" is not the same as "bob") You can add exact ALT-Coded entries here (copy/paste from your logs)
- -- most of these names are auto-generated by halo (english install), or are common noob names you wish to replace
- unwanted_names = {autogen, "+%+", "Donut", "Penguin", "Stumpy", "Whicker", "Shadow", "Howard", "Wilshire", "Darling", "Disco", "Jack", "The Bear", "Sneak", "The Big L", "Whisp",
- "Wheezy", "Crazy", "Goat", "Pirate", "Saucy", "Hambone", "Butcher", "Walla Walla", "Snake", "Caboose", "Sleepy", "Killer", "Stompy", "Mopey",
- "Dopey", "Weasel", "Ghost", "Dasher", "Grumpy", "Hollywood", "Tooth", "Noodle", "King", "Cupid", "Prancer", "POQ Sucks"
- }
- -- new replacement names to replace unwanted names.
- -- new names CANNOT be more than 10 characters long! Each entry must be in "quotes" and a comma between entries.
- replacement_names = {"Beau", "Bobby Joe", "Bodean", "Bubba", "Buck", "Cletus", "Cleon", "Billy Bob", "Beauford", "Jethro", "Orville", "Joe Bob", "Bucephelus", "Wilford", "Clyde",
- "Delmont", "Duke", "Eustice", "Earl", "Floyd", "Forrest", "Jim Bob", "Jimmy Don", "John Boy", "Otis", "Pervis", "Roscoe", "Saggory", "Rufus", "Tiberius", "Billy Bo Bob", "Bubba, Jr.",
- "Cooter", "Elrod", "Jed", "Jebediah", "Junior, Jr.", "Bubba, Jr.", "Gunther", "Ellie Mae", "Sue Ellen", "Earlene", "Bertha", "Peggy Sue", "Daisy Mae", "Henrietta", "Annabelle", "Bambi", "Betty Jo",
- "Betty Lou", "Billie Jean", "Bobbie Sue", "Buffy", "Claudette", "Delilah", "Georgette", "Jaylnn Jo", "Jozelle", "Hattie", "Layla", "Linda Sue", "Martha-Mae", "Roxxy", "Peach", "Tucker",
- "Patty Sue", "Shaneyney", "Trixibelle", "Waynelle", "Beaula", "Brandine", "Larlene", "Lilah", "Savannah", "Shelbylyn", "Lula", "Abner", "Barney", "Cal", "Chester", "Cy", "Cyrus", "Gus", "Homer",
- "Ike", "Jasper", "Jeb", "Jethro", "Lem", "Luke", "Wilbur", "Willie", "Zeb", "Zed", "Zeke", "Hayseed", "Big Daddy", "West", "Les", "Meatloaf", "Uncle Ben", "Ronda", "Cherry", "Shawnda", "Vonda",
- "Destiny", "Claudine", "Dreama", "EvaJo", "Faylene", "Gracelyn", "January", "Jazlean", "Kaylin", "Loribelle", "Misty Dawn", "Norma", "Raylene", "Rubyjane", "Sapphire", "Sheena", "Summer", "Sunset",
- "Tabitha", "Vanity", "Kandy", "Erneshia", "Jicelle", "Mandy Lynn", "Misty Rain", "Amaleen", "Baylie", "Brittney", "Tits McGee"
- }
- -- bad strings, Only lowercase! if a 'portion' (string) of these bad names enter, add players entry name to unwanted_names table, then replace
- -- example: "nigg" as a bad name will catch "nigger", "nigga" and "nigguh",
- -- whereas, a player named "grape" will have name replaced because "rape" is a bad string
- -- if "ass" was listed here (it's not), a player named Assassin would have their name replaced,
- -- "assh" is listed, so a player named "asshole" or "asshat" would have their name replaced
- bad_strings = {"fuck", "fuk", "shit", "bitch", "cock", "cok", "cunt", "nigg", "jew", "rape", "vehic", "puss", "rapist", "negro", "spic", "wetback",
- "your mom", "madre", "new00", "nuevo", "phuck", "phuk", "assh", "mike hunt", "penis", "dick", "vagina", "kkk", "hitler"
- }
- -- find unwanted strings in player names
- local AsIs = name
- local name = string.lower(name)
- for k,v in pairs(bad_strings) do
- if (string.gsub(name,string.lower(v),"") ~= name) then
- table.insert(unwanted_names, AsIs)
- end
- end
- -- find unwanted player names, replace them, and log into phasors game log
- for k,v in pairs(unwanted_names) do
- if v == name then
- local rand_name = getrandomnumber(1, #replacement_names+1)
- new_name = string.format("%s", replacement_names[rand_name])
- log_msg(1, name .. " was given the new name of " .. new_name .. ", hash: " .. hash)
- table.remove(replacement_names, rand_name)
- newnames[hash] = true
- return true, new_name
- else
- new_name = AsIs
- end
- end
- return true, new_name
- end
- function sendresponse(message, player)
- if player then
- privatesay(player, message)
- else
- hprintf(message)
- end
- end
- -- Created by H® Shaft
- -- Visit http://halorace.org/forum/index.php
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement