Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onSay(cid, words, param, channel)
- if(param == '') then
- doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param [Ex: /"..words.." name, tempo em dias, comentário].")
- return true
- end
- local t = string.explode(param, ",")
- local pid = getPlayerByNameWildcard(t[1])
- local tempo = tonumber(t[2])
- local comment = tostring(t[3])
- if comment == "" then
- comment = "No comment declared."
- end
- if isNumber(t[2]) then
- if pid then
- --[[ Banindo Player Online -- By Swatt ]]--
- doAddIpBanishment(getPlayerIp(pid), tempo * 24 * 60 * 60, comment)
- doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "O jogador "..t[1].." foi banido por "..tempo.." dias com sucesso [Player Online].")
- doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_RED, "Sua IP foi banida por "..tempo.." dia(s) por "..comment..".")
- else
- --[[ Banindo Player Offline -- By Swatt ]]--
- getPID = getPlayerGUIDByName(t[1])
- local q = db.getResult("SELECT `id`, `lastip` FROM `players` WHERE `id` = "..getPID..";")
- if q:getID() ~= -1 then
- lip = q:getDataString("lastip")
- if lip ~= nil then
- doAddIpBanishment(lip, tempo * 24 * 60 * 60, comment)
- doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "A IP do jogador "..t[1].." foi adicionada a lista de banimento por "..tempo.." dia(s) com sucesso [Player Offline].")
- else
- doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "A IP deste personagem consta NULA na database.")
- end
- else
- doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Personagem "..t[1].." não encontrado na database.")
- end
- end
- else
- doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param [Ex: /"..words.." name, tempo em dias, comentário].")
- end
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment