Elexonic
Well-Known Member
- Joined
- Jun 18, 2008
- Messages
- 1,920
- Reaction score
- 59
I have one problem in my ot ... no can UNBAN players..
this is my script for ban..
And this is my script.. UNBAN..
When using this script say..
16:16 IP Banishment on 0.0.0.0 has been lifted.
But no unbaned :S
this is my script for ban..
Code:
function onSay(cid, words, param)
local t = string.explode(string.lower(param), ",")
if not t[1] then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.") return true
end
local player = getPlayerByNameWildcard(t[1])
if(not player)then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player not found.") return true
end
local days = not tonumber(t[2]) and 1 or tonumber(t[2])
doBroadcastMessage(getCreatureName(player).." was banned by "..getCreatureName(cid))
doAddIpBanishment(getPlayerIp(player), days * 24 * 60 * 60)
doRemoveCreature(player)
return true
end
And this is my script.. UNBAN..
Code:
function onSay(cid, words, param, channel)
if(param == '') then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
return true
end
local account, tmp = getAccountIdByName(param), true
if(account == 0) then
account = getAccountIdByAccount(param)
if(account == 0) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player or account '" .. param .. "' does not exists.")
return true
end
tmp = false
end
local ban = getBanData(account, BAN_ACCOUNT)
if(ban and doRemoveAccountBanishment(account)) then
local name = param
if(tmp) then
name = account
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, name .. " has been " .. (ban.expires == -1 and "undeleted" or "unbanned") .. ".")
end
if(not tmp) then
return true
end
tmp = getIpByName(param)
if(isIpBanished(getPlayerIp) and doRemoveIpBanishment(getPlayerIp)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "IP Banishment on " .. doConvertIntegerToIp(ip) .. " has been lifted.")
end
local guid = getPlayerGUIDByName(param, true)
if(guid == nil) then
return true
end
ban = getBanData(guid, BAN_PLAYER, PLAYERBAN_LOCK)
if(ban and doRemovePlayerBanishment(guid, PLAYERBAN_LOCK)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Namelock from " .. param .. " has been removed.")
end
ban = getBanData(guid, BAN_PLAYER, PLAYERBAN_BANISHMENT)
if(ban and doRemovePlayerBanishment(guid, PLAYERBAN_BANISHMENT)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, param .. " has been " .. (ban.expires == -1 and "undeleted" or "unbanned") .. ".")
end
return true
end
When using this script say..
16:16 IP Banishment on 0.0.0.0 has been lifted.
But no unbaned :S