Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ ### Replace Player Names v1.0 ###]]--
- --[[ ### by H® Shaft for Phasor v2+ ###]]--
- -- This will replace unwanted player names with the "replacement_name" you specify (below) and also log the name change in the game log.
- -- You can add names to the table (replace_table) with the name you want replaced in quotes separated by comma between names. (case sensitive)
- -- If a player joins with a name that is in the table, it will be replaced with the new name, and number.
- -- All random names built into halo (profile name "+%+") are already in the list, as well as "vehicle", "your mom", etc.
- -- Inappropriate names can be added to this table as well, rather than blocking entry or banning.
- -- If there is interest, I will re-write this to read-from and write-to files on the host server, along with adding admin function to add/remove names.
- -- NOTE: failing to put names in quotes, or failing to separate names with comma's will result in an error.
- replacement_name = "GUEST" -- | Edit this name, no more than 6 characters, it will generate a new name: "GUEST_1", "GUEST_2", etc.
- replace_table = {"+%+", "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", "New001", "new001", "Nuevo001",
- "Vehicle", "vehicle", "Your Mom", "your mom"
- }
- newnames = {}
- function GetRequiredVersion()
- return 200
- end
- function OnScriptLoad(process, game, persistent)
- namenumber = 0
- 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
- privatesay(player, "The server has replaced your name. Your new name is: " .. getname(player))
- end
- end
- end
- function OnPlayerLeave(player)
- if getplayer(player) then
- newnames[gethash(player)] = nil
- end
- end
- function OnNameRequest(hash, name, new_name)
- namenumber = namenumber + 1
- hprintf(name .. " is attempting to join the server.")
- for k,v in pairs(replace_table) do
- if v == name then
- new_name = (replacement_name .. "_" .. namenumber)
- log_msg(1, name .. " was given the new name of " .. new_name .. " hash: " .. hash)
- newnames[hash] = true
- return true, new_name
- else
- new_name = name
- end
- end
- return true, new_name
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement