Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function OnChat(event, pPlayer, Message, Type, Language, Misc)
- if(pPlayer:IsGm()) then
- local cmd, sub, id, dur, reason = Message:match("^[.!](%a+) (%a+) ([%d%p%a]+) ?(%w*) ?(%w*)$")
- if(not (cmd and sub and id and dur and reason)) then
- return
- end
- if(string.find("ban", cmd:lower()) == 1) then
- local sub_t
- if(string.find("ip", sub:lower()) == 1) then
- sub_t = "IP"
- elseif(string.find("char", sub:lower()) == 1) then
- sub_t = "character"
- elseif(string.find("account", sub:lower()) == 1) then
- sub_t = "account"
- elseif(string.find("all", sub:lower()) == 1) then
- sub_t = "IP, account, character"
- else
- return
- end
- if(reason == '') then
- reason = "no reason"
- end
- if(dur == '') then -- should elaborate dur more
- dur = "infinity"
- elseif(not dur:find("%d")) then
- reason = dur
- dur = "infinity"
- end
- -- SendWorldMessage("|cffFF0000[GM] "..pPlayer:GetName().." banned "..sub_t.." "..id.." for "..dur..reason, 2)
- SendWorldMessage("|cffFF0000[GM] ["..id.."]'s "..sub_t.." has been banned by ["..pPlayer:GetName().."] for ["..dur.."] Reason:["..reason.."]", 2)
- end
- end
- end
- RegisterServerHook(16, OnChat)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement