• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Unban

Status
Not open for further replies.

Sherlok

Active Member
Joined
Aug 29, 2008
Messages
2,116
Reaction score
44
Location
Poland, Wrocław.
Hiho.
I need talkaction script:
  • If you have XXXX item in backpack, say !unban <nickname> and your character will be unbanished and item deleted :thumbup:

Thanks, rep++
 
TESTED AND WORKING!
I'm noob in lua but will learn :)


Item = Unban item
Text = Name of item

THIS WILL NOT UNBAN IP-BANISHMENTS. ONLY NORMAL BANISHMENTS!
LUA:
function onSay(cid, words, param, channel)
	local item = 2160
	local text = "a crystal coin"
	if getPlayerItemCount(cid, item) > 0 then
		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") .. ".")
		doPlayerRemoveItem(cid, item, 1)
		else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This player is not banned.")
	end
	if(not tmp) then
		return true
	end
		local guid = getPlayerGUIDByName(param, true)
	if(guid == nil) then
		return true
	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") .. ".")
		doPlayerRemoveItem(cid, item, 1)
	end	
	else
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need ".. text .." to get unbanned.")
	end
	return true
end

Edit :
If you want me to make so you have to use example the command/item 2x to get rid of the IP-banishment, tell me :)
 
Last edited:
haha, but how you want to login to use it? xD

new character or friend

TESTED AND WORKING!
I'm noob in lua but will learn :)


Item = Unban item
Text = Name of item

THIS WILL NOT UNBAN IP-BANISHMENTS. ONLY NORMAL BANISHMENTS!
LUA:
function onSay(cid, words, param, channel)
	local item = 2160
	local text = "a crystal coin"
	if getPlayerItemCount(cid, item) > 0 then
		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") .. ".")
		doPlayerRemoveItem(cid, item, 1)
		else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This player is not banned.")
	end
	if(not tmp) then
		return true
	end
		local guid = getPlayerGUIDByName(param, true)
	if(guid == nil) then
		return true
	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") .. ".")
		doPlayerRemoveItem(cid, item, 1)
	end	
	else
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need ".. text .." to get unbanned.")
	end
	return true
end

Edit :
If you want me to make so you have to use example the command/item 2x to get rid of the IP-banishment, tell me :)

for 0.3.6pl1?
 
Last edited:
That's a good question, how do you expect to log online and use that command if you're banned?
 
Status
Not open for further replies.
Back
Top