Postado Novembro 4, 2012 12 anos Este é um post popular. Trouxe pra vocês um sistema. Mas não é um sistema qualquer. É aquele tão cobiçado sistema de banimento do servidor RadBr! O que é: É um sistema de banimento através de warnings setadas pelo GOD em um player, e outro player poderá desbanir este já banido por barras (Default ID: 9971), dependendo do número de warnings. Script: Atenção: Primeiro, execute esta query na sua database: Sqlite: CREATE TABLE "account_storage" ( "acc_id" INTEGER NOT NULL, "key" INTEGER NOT NULL, "value" VARCHAR(255) NOT NULL DEFAULT '0', UNIQUE ("acc_id", "key"), FOREIGN KEY ("acc_id") REFERENCES "accounts" ("id") ); Mysql: CREATE TABLE `account_storage` ( `acc_id` INT NOT NULL DEFAULT 0, `key` INT UNSIGNED NOT NULL DEFAULT 0, `value` VARCHAR(255) NOT NULL DEFAULT '0', KEY (`acc_id`), UNIQUE (`acc_id`, `key`), FOREIGN KEY (`acc_id`) REFERENCES `accounts`(`id`) ON DELETE CASCADE ) ENGINE = InnoDB; <talkaction words="/ban" access="2" script="radbrban.lua"/> <talkaction words="!unban" script="radbrunban.lua"/> doAddAccountBanishment(getAccountIdByName(t[1]), target, os.time() + (a[tonumber(t[3])]*3600*24), 5, 2, t[2], 0) ------------------------------------------------------------------------------------------------------------------------------------------ doAddAccountBanishment(getAccountIdByName(t[1]), target, os.time() + (a[getWarnings(t[1])]*3600*24), 5, 2, t[2], 0) Por essas: doAddBanishment(getAccountIdByName(t[1]), os.time() + (a[tonumber(t[3])]*3600*24), 1, 2, t[2], 0) ------------------------------------------------------------------------------------------------------------------------------------------ doAddBanishment(getAccountIdByName(t[1]), os.time() + (a[getWarnings(t[1])]*3600*24), 1, 2, t[2], 0) /ban Nome,Motivo,Warnings* !unban Nome *OBS: Não é obrigatório especificar as warnings no comando /ban. Se não forem especificadas, serão adicionadas +1 warning automaticamente. (Exemplo: /ban Nome,Motivo) Observações: - Sou lindo, eu sei Créditos: - LuckOake (Pelo Sistema) Scripts: Em MOD: <?xml version="1.0" encoding="UTF-8"?> <mod name="RadBr Banishment System" version="1.0" author="LuckOake" contact="none" enabled="yes"> ------------------------------------------------------------------------------------ <config name="radban"><![CDATA[ barid = 9971 -- ID das barras para desbanir function getPlayerAccountStorageValue(name, key) local result, ret = db.getResult("SELECT `value` FROM `account_storage` WHERE `acc_id` = '".. getAccountIdByName(name) .."' AND `key` = ".. key ..";") if result:getID() == -1 then return nil end ret = result:getDataInt("value") result:free() return ret end function setPlayerAccountStorageValue(name, key, value) local result = db.getResult("SELECT * FROM `account_storage` WHERE `acc_id` = ".. getAccountIdByName(name) .." AND `key` = ".. key ..";") if result:getID() == -1 then return db.executeQuery("INSERT INTO `account_storage` (`acc_id`, `key`, `value`) VALUES (".. getAccountIdByName(name) ..", ".. key ..", ".. value ..");") else result:free() return db.executeQuery("UPDATE `account_storage` SET `value` = ".. value .." WHERE `acc_id` = ".. getAccountIdByName(name) .." AND `key` = ".. key ..";") end end function getWarnings(name) return getPlayerAccountStorageValue(name, 21798) end function setWarnings(name, count) return setPlayerAccountStorageValue(name, 21798, count) end ]]></config> ------------------------------------------------------------------------------------ <talkaction words="!ban" event="buffer"><![CDATA[ domodlib('radban') local t = string.explode(param, ",") local a = { [1] = 7, [2] = 14, [3] = 30, [4] = 60, [5] = 9999, [6] = 9999, [7] = 9999, [8] = 9999, [9] = 9999, [10] = 9999, [11] = 9999, } local b = a[t[3]] if not t[2] or tonumber(t[2]) or t[3] and not tonumber(t[3]) or t[4] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Especifique nome,motivo,warnings(opcional).") return true elseif not getPlayerGUIDByName(t[1]) then doPlayerSendCancel(cid, "O jogador "..t[1].." não existe.") return true elseif isAccountBanished(getAccountIdByName(t[1])) then doPlayerSendCancel(cid, "O player "..t[1].." já está banido.") return true elseif t[3] and tonumber(t[3]) < 1 then doPlayerSendCancel(cid, "Desculpe, mas o mínimo de warnings é 1.") return true elseif t[3] and tonumber(t[3]) > 11 then doPlayerSendCancel(cid, "Desculpe, mas o máximo de warnings é 11.") return true elseif not getWarnings(t[1]) or getWarnings(t[1]) < 0 then setWarnings(t[1], 0) elseif t[3] and tonumber(t[3]) <= getWarnings(t[1]) then doPlayerSendCancel(cid, "Desculpe, mas esse player já tem "..getWarnings(t[1]).." warnings.") return true end if getPlayerByName(t[1]) then doRemoveCreature(getPlayerByName(t[1])) end if t[3] then doAddAccountBanishment(getAccountIdByName(t[1]), target, os.time() + (a[tonumber(t[3])]*3600*24), 5, 2, t[2], 0) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você baniu o jogador "..t[1]..". Warnings setadas de "..getWarnings(t[1]).." para "..t[3]..".") broadcastMessage("Jogador "..t[1].." notificado por "..getCreatureName(cid)..". Notificações setadas de "..getWarnings(t[1]).." para "..t[3]..". Comentário: "..t[2]..".") setWarnings(t[1], tonumber(t[3])) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você baniu o jogador "..t[1]..". Warnings setadas de "..getWarnings(t[1]).." para "..(getWarnings(t[1])+1)..".") broadcastMessage("Jogador "..t[1].." notificado por "..getCreatureName(cid)..". Notificações setadas de "..getWarnings(t[1]).." para "..(getWarnings(t[1])+1)..". Comentário: "..t[2]..".") setWarnings(t[1], getWarnings(t[1])+1) doAddAccountBanishment(getAccountIdByName(t[1]), target, os.time() + (a[getWarnings(t[1])]*3600*24), 5, 2, t[2], 0) end return true ]]></talkaction> ------------------------------------------------------------------------------------ <talkaction words="!unban" event="buffer"><![CDATA[ domodlib('radban') local a = { [1] = 20, [2] = 40, [3] = 60, [4] = 90, [5] = 120, [6] = 150, [7] = 250, [8] = 350, [9] = 500, [10] = 750, [11] = 999, } b = a[getWarnings(param)] if not getPlayerGUIDByName(param) then doPlayerSendCancel(cid, "O jogador "..param.." não existe.") return true elseif not isAccountBanished(getAccountIdByName(param)) then doPlayerSendCancel(cid, "Esse jogador não está banido.") return true elseif not doPlayerRemoveItem(cid, barid, b) then doPlayerSendCancel(cid, "Você deve ter "..b.." gold ingots para desbanir esse jogador.") return true end doRemoveAccountBanishment(getAccountIdByName(param)) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você desbaniu o jogador "..param.." pelo preço de "..b.." gold ingots.") return true ]]></talkaction> </mod> Em Lua: radbrban.lua: function onSay(cid, words, param) local t = string.explode(param, ",") local a = { [1] = 7, [2] = 14, [3] = 30, [4] = 60, [5] = 9999, [6] = 9999, [7] = 9999, [8] = 9999, [9] = 9999, [10] = 9999, [11] = 9999, } local b = a[t[3]] if not t[2] or tonumber(t[2]) or t[3] and not tonumber(t[3]) or t[4] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Especifique nome,motivo,warnings(opcional).") return true elseif not getPlayerGUIDByName(t[1]) then doPlayerSendCancel(cid, "O jogador "..t[1].." não existe.") return true elseif isAccountBanished(getAccountIdByName(t[1])) then doPlayerSendCancel(cid, "O player "..t[1].." já está banido.") return true elseif t[3] and tonumber(t[3]) < 1 then doPlayerSendCancel(cid, "Desculpe, mas o mínimo de warnings é 1.") return true elseif t[3] and tonumber(t[3]) > 11 then doPlayerSendCancel(cid, "Desculpe, mas o máximo de warnings é 11.") return true elseif not getWarnings(t[1]) or getWarnings(t[1]) < 0 then setWarnings(t[1], 0) elseif t[3] and tonumber(t[3]) <= getWarnings(t[1]) then doPlayerSendCancel(cid, "Desculpe, mas esse player já tem "..getWarnings(t[1]).." warnings.") return true end if getPlayerByName(t[1]) then doRemoveCreature(getPlayerByName(t[1])) end if t[3] then doAddAccountBanishment(getAccountIdByName(t[1]), target, os.time() + (a[tonumber(t[3])]*3600*24), 5, 2, t[2], 0) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você baniu o jogador "..t[1]..". Warnings setadas de "..getWarnings(t[1]).." para "..t[3]..".") broadcastMessage("Jogador "..t[1].." notificado por "..getCreatureName(cid)..". Notificações setadas de "..getWarnings(t[1]).." para "..t[3]..". Comentário: "..t[2]..".") setWarnings(t[1], tonumber(t[3])) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você baniu o jogador "..t[1]..". Warnings setadas de "..getWarnings(t[1]).." para "..(getWarnings(t[1])+1)..".") broadcastMessage("Jogador "..t[1].." notificado por "..getCreatureName(cid)..". Notificações setadas de "..getWarnings(t[1]).." para "..(getWarnings(t[1])+1)..". Comentário: "..t[2]..".") setWarnings(t[1], getWarnings(t[1])+1) doAddAccountBanishment(getAccountIdByName(t[1]), target, os.time() + (a[getWarnings(t[1])]*3600*24), 5, 2, t[2], 0) end return true end radbrunban.lua: function onSay(cid, words, param) local a = { [1] = 20, [2] = 40, [3] = 60, [4] = 90, [5] = 120, [6] = 150, [7] = 250, [8] = 350, [9] = 500, [10] = 750, [11] = 999, } b = a[getWarnings(param)] if not getPlayerGUIDByName(param) then doPlayerSendCancel(cid, "O jogador "..param.." não existe.") return true elseif not isAccountBanished(getAccountIdByName(param)) then doPlayerSendCancel(cid, "Esse jogador não está banido.") return true elseif not doPlayerRemoveItem(cid, 9971, b) then doPlayerSendCancel(cid, "Você deve ter "..b.." gold ingots para desbanir esse jogador.") return true end doRemoveAccountBanishment(getAccountIdByName(param)) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você desbaniu o jogador "..param.." pelo preço de "..b.." gold ingots.") return true end Lib: function getOfflinePlayerStorageValue(name, key) local result, ret = db.getResult("SELECT `value` FROM `player_storage` WHERE `player_id` = '".. getPlayerGUIDByName(name) .."' AND `key` = ".. key ..";") if result:getID() == -1 then return nil end ret = result:getDataInt("value") result:free() return ret end function setOfflinePlayerStorageValue(name, key, value) local result = db.getResult("SELECT * FROM `player_storage` WHERE `player_id` = ".. getPlayerGUIDByName(name) .." AND `key` = ".. key ..";") if result:getID() == -1 then return db.executeQuery("INSERT INTO `player_storage` (`player_id`, `key`, `value`) VALUES (".. getPlayerGUIDByName(name) ..", ".. key ..", ".. value ..");") else result:free() return db.executeQuery("UPDATE `player_storage` SET `value` = ".. value .." WHERE `player_id` = ".. getPlayerGUIDByName(name) .." AND `key` = ".. key ..";") end end function getWarnings(name) return getOfflinePlayerStorageValue(name, 21798) end function setWarnings(name, count) return setOfflinePlayerStorageValue(name, 21798, count) end Tags: OBS: Se seu server for versão 8.7 pra cima, substitua essas linhas: Configurando: Únicas configurações são essas: local barid = 9971 -- ID das barras para desbanir -------------------------------------------------------------------------------- local a = { -- Número da warning = Número de barras necessárias [1] = 20, [2] = 40, [3] = 60, [4] = 90, [5] = 120, [6] = 150, [7] = 250, [8] = 350, [9] = 500, [10] = 750, [11] = 999, } Imagens: ------------------------------------------------------------------------------------------------------ Uso: Editado Novembro 4, 2012 12 anos por LuckOake (veja o histórico de edições)
Postado Novembro 4, 2012 12 anos Muito obrigado por trazer esse conteúdo ao TibiaKing.com! Você é novo aqui? se sim, seja bem-vindo. REPUTADO!
Postado Novembro 4, 2012 12 anos Que Bom Luck , Sou Seu Fan e Seja Bem Vindo.. Quero Voltar a Jogar Subwat Extreme Fun Heiin :angry2:
Postado Novembro 4, 2012 12 anos Muito obrigado pelo conteudo Luck! # Regras Gerais - TibiaKing.com # Contato: [email protected]Não respondo dúvidas via MP.
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.