Nossa cara,excelente.
Muito bom,parabéns hein.Bem interessante este script.
Continue seu trabalho postando esses scripts excelentes ^^
Por caotic, 18 de jan. de 2013 em Mods, funções e outros
info
Grupo: Marquês
Registrado: 29/10/11
Posts: 1.2k
Reputação: +134
Gênero: Masculino

Nossa cara,excelente.
Muito bom,parabéns hein.Bem interessante este script.
Continue seu trabalho postando esses scripts excelentes ^^
info
Grupo: Infante
Registrado: 04/03/11
Posts: 1.6k
Reputação: +393
Char no Tibia: No Have
Ola galera xtibiana
O radio system eu ja tinha feito numa versão "beta" mais estava muito limitado.
O link do sistema beta http://www.xtibia.com/forum/topic/190386-radio-sytem/
Então resolvi fazer uma versão superior
O radio sytem e um sistema de (channel ou estações).
Um player cria uma nova radio e depois outro player "sincroniza" a partir disso o dono da radio pode mandar mensagens a todos os participantes
Para procurar uma radio e exibido uma janela que monstra o (Id da radio, dono da radio, radio esta online ou offline)
Vamos aos códigos:
function getRadPlayer(cid) local rad = db.getResult("SELECT `rad` FROM `players` WHERE `id` = "..getPlayerGUID(cid)) return rad:getID() ~= -1 and rad:getDataInt("rad") or false end function setPlayerRad(cid, rad) db.executeQuery("UPDATE `players` SET `rad` = "..rad.." WHERE `id` = "..getPlayerGUID(cid)) end function createNewRad(cid) db.executeQuery("INSERT INTO `rad` VALUES (".. getPlayerGUID(cid) ..", ".. 1 ..")") db.executeQuery("UPDATE `players` SET `rad` = "..getPlayerGUID(cid).." WHERE `id` = "..getPlayerGUID(cid)) end function getOwnerIdRad(cid) local rad = db.getResult("SELECT * FROM `rad` WHERE `id` = ".. getPlayerGUID(cid) ..";") return rad:getID() ~= -1 and rad:getDataInt("id") or false end function getRadMens(cid) local rad = db.getResult("SELECT * FROM `rad` WHERE `id` = ".. getPlayerGUID(cid) ..";") return rad:getID() ~= -1 and rad:getDataInt("mens") or 0 end function getPlayerOwnerRad(cid) local rad = db.getResult("SELECT * FROM `rad` WHERE `id` = ".. getPlayerGUID(cid) ..";") return rad:getID() ~= -1 and true or false end function getExistRad(id) local rad = db.getResult("SELECT * FROM `rad` WHERE `id` = ".. id ..";") return rad:getID() ~= -1 and true or false end function sendTextForRad(cid, text) local rad = db.getResult("SELECT * FROM `rad` WHERE `id` = ".. getPlayerGUID(cid) ..";") local mens = getRadMens(cid)+1 for i =1, #getPlayersOnline() do if getRadPlayer(getPlayersOnline()[i]) == getPlayerGUID(cid) then doPlayerSendTextMessage(getPlayersOnline()[i], MESSAGE_INFO_DESCR, text) db.executeQuery("UPDATE `rad` SET `mens` = "..mens.." WHERE `id` = "..getPlayerGUID(cid)) end end endVá em talkactions e crie um arquivo lua chamado de rad e coloque isto:
Continue em talkactions e crie um arquivo lua chamado de list e coloque isto:
function onSay(cid, words, param, channel) local rad = db.getResult("SELECT * FROM `rad` WHERE `id` ORDER BY `mens`") str = "Radio Ons:\n\n" if rad:getID() == -1 then doShowTextDialog(cid, 1387, "Não ha radio online") return true end while true do local id = rad:getDataInt("id") local name = getPlayerByNameWildcard(getPlayerNameByGUID(id)) and getPlayerNameByGUID(id) or "offline" str = str .. id .. " - Dono da Radio - ("..name..")\n\n" if not rad:next() then doShowTextDialog(cid, 1397, str) break end end return true endDepois em talkactions de novo crie um arquivo lua chamado de createrad e coloque isto:
Terminado na mesma pasta(talkactions) crie um arquivo lua chamado de txt e coloque isto:
function onSay(cid, words, param, channel) local t = string.explode(param, ",") if not t[1] then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Coloca a mensagem que deseja enviar para os participantes da sua radio") and false end if not getPlayerOwnerRad(cid) then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não tem radio") and false end if #param < 4 then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sua mensagem deve ser maior") and false end sendTextForRad(cid, "("..getOwnerIdRad(cid)..") "..getPlayerName(cid).." - "..t[1].." ") return true endColoque esta tags em talkactions.xml:
Para usar e simples:
Editado Janeiro 18 por caotic