Comandos muito utéis, irei por no meu server.
Obrigado por trazer conteúdo ao Xtibia.
Só não do Rep+ agora pq já atingi o limite de hoje.
Por SkyDangerous, 26 de dez. de 2011 em Actions e Talkactions
info
Grupo: Campones
Registrado: 08/12/09
Posts: 76
Reputação: +27
Char no Tibia: Zoralurk

Comandos muito utéis, irei por no meu server.
Obrigado por trazer conteúdo ao Xtibia.
Só não do Rep+ agora pq já atingi o limite de hoje.
info
Grupo: Herói
Registrado: 23/12/08
Posts: 2.4k
Reputação: +359
Gênero: Masculino
Char no Tibia: Gordo Warlike

muito bom script sky!
não é atoa q sou seu fan shaushau!
info
Grupo: Conde
Registrado: 16/06/08
Posts: 998
Reputação: +185
Gênero: Masculino

o cara fez isso tudo sem usar uma query, que cara foda.
testando identação kk
function getOnlineGuildMembers(cid)
local t = {}
local p = getPlayersOnline()
local g = getPlayerGuildId(cid)
for _, ps in ipairs(p) do
local gs = getPlayerGuildId(ps)
if(g == gs and gs > 0 and g > 0) then
table.insert(t, ps)
end
end
return t
end
function getGuildMembersByVoc(cid, voc)
local h = getOnlineGuildMembers(cid)
for _, gid in ipairs(h) do
local vg = getPlayerVocation(gid)
if(vg == voc) then
local gv = {}
table.insert(gv, gid)
return gv
end
end
return false
end
function getPartyMembersByVoc(cid, voc)
local h = getPartyMembers(cid)
local yv = {}
for _, yid in ipairs(h) do
local vx = getPlayerVocation(yid)
if(vx == voc) then
table.insert(yv, yid)
end
end
return yv
end
local text = ""
local count = 0
local vocCount = {}
local regv = {}
local highlevel = 125
function onSay(cid, words, param, channel)
if(words == "!partycheck") then
local pmem = getPartyMembers(getPartyLeader(cid))
text = "-- Party Check --\n"
if(type(pmem) == "table") then
if(#pmem <= 1) then
text = text .. "You are alone!!!"
return doPlayerSendTextMessage(cid, 22, text)
elseif(#pmem > 1) then
for i = 0, 4 do
local k = getPartyMembersByVoc(cid, i)
local vocvar = getVocationInfo(i).name
text = text .. " " .. #k .. " " .. vocvar .. "\n"
end
local k2 = getPartyMembersByVoc(cid, 4)
text = text .. "\n --High knights: "
for _, kid in ipairs(k2) do
local klvl = getPlayerLevel(kid)
if(klvl >= highlevel) then
count = count + 1
if(count <= 3) then
text = text .. getPlayerName(kid) .. "[".. klvl .."]" .. (count < 3 and ", " or ".")
end
end
end
text = text .. "."
end
else
text = "-- You are not in any party. -- "
end
elseif(words == "!guildcheck") then
local gmem = getOnlineGuildMembers(cid)
text = "-- Guild Check --\n"
if(#gmem ~= 0) then
local noneCount = 0
local g = {name = getPlayerGuildName(cid)}
text = "[".. g.name .."] There are ".. #gmem .." players playing. "
for _, gid in ipairs(gmem) do
noneCount = noneCount + 1
text = text .. getPlayerName(gid) .. (noneCount == #gmem and "." or ", ")
end
local k2 = getPartyMembersByVoc(cid, 4)
text = text .. "\n --High knights: "
for _, kid in ipairs(k2) do
local klvl = getPlayerLevel(kid)
if(klvl >= highlevel) then
count = count + 1
if(count <= 3) then
text = text .. getPlayerName(kid) .. "[".. klvl .."]" .. (count < 3 and ", " or ".")
end
end
end
text = text .. "."
else
text = "You are not in a guild."
end
end
return doPlayerSendTextMessage(cid, 22, text)
end
Editado Dezembro 26 por fireelement
info
Grupo: Lorde
Registrado: 17/01/09
Posts: 2.1k
Reputação: +395
Char no Tibia: Adra Sata

Nao e necessario query.
Pois o script pega os players online e informacoes do servidor e nao tem necessidade utiliza extracoes de informacoes pelo banco de dados(sql)
Mas acho que daria pra fazer com query
..
Sei la kkk
Att..
Editado Dezembro 26 por SkyDangerous
info
Grupo: Administrador
Registrado: 08/07/05
Posts: 5.8k
Reputação: +1.4k
Gênero: Outro

Interessante Sky,
Pelo visto a galera gostou mesmo ![]()
info
Grupo: Conde
Registrado: 17/07/11
Posts: 705
Reputação: +108

Eu não achei necessariamente útil o da guild para os ot servers com xampp, pois esse comando já existe parecido, porém fica no site.
Porém o da party, eu jamais tinha visto esse dai, para mim não seria de grande utilidade, pois todos que ficaram de party comigo, são do skype, mas tem gente ai que deve precisar, eu acho. E também, quando o player morre, ele perde o party, seria legal se você fize-se um comando, desenvolvendo as sources (projeto em grupo), que faria parecido com o comando party, mas seria para pkalizar. Ai quando um player do comando pkalizador morre-se, apareceria no /b:
(Playername) Da Guild (Namedaguild) Foi morto pelos (Playername) (playername) da guild (guildname).
Esse comando seria muito útil, pois os caras que pkaliza, ás vezes não tem guild e pode fazer um grupo de matar, mas não uma guild, pois pkalizar só tem fins lucrativos, honra, fama e status
.
Mas o comando da guild seria bom para ot servers sem o xampp, mas inúteis para os com xampp.
Já o da party, achei legalzinho, para os dois ot servers.
Credits by Xafterin of otserv.es...
@up:
KylerXX and Xafterin -> same person. (Faisher). Haha ![]()
info
Grupo: Lorde
Registrado: 17/01/09
Posts: 2.1k
Reputação: +395
Char no Tibia: Adra Sata
Funções:
Comando: !partycheck
Ele mostra no channel quanto de cada vocação estão na party e mostra os três Knights mais forte(caso queria utilizar-lo para blocar)
Comando: !guildcheck
Ele mostra no channel do servidor quantos jogadores da sua guild estão on-line mostrando os nomes e também mostra os três knights mais forte.
Testado em: TFS 0.3.6
Crie um arquivo qualquer com nome de partyguildcheck.lua e adicione o comando abaixo
function getOnlineGuildMembers(cid) local t = {} local p = getPlayersOnline() local g = getPlayerGuildId(cid) for _, ps in ipairs(p) do local gs = getPlayerGuildId(ps) if(g == gs and gs > 0 and g > 0) then table.insert(t, ps) end end return t end function getGuildMembersByVoc(cid, voc) local h = getOnlineGuildMembers(cid) for _, gid in ipairs(h) do local vg = getPlayerVocation(gid) if(vg == voc) then local gv = {} table.insert(gv, gid) return gv end end return false end function getPartyMembersByVoc(cid, voc) local h = getPartyMembers(cid) local yv = {} for _, yid in ipairs(h) do local vx = getPlayerVocation(yid) if(vx == voc) then table.insert(yv, yid) end end return yv end local text = "" local count = 0 local vocCount = {} local regv = {} local highlevel = 125 function onSay(cid, words, param, channel) if(words == "!partycheck") then local pmem = getPartyMembers(getPartyLeader(cid)) text = "-- Party Check --\n" if(type(pmem) == "table") then if(#pmem <= 1) then text = text .. "You are alone!!!" return doPlayerSendTextMessage(cid, 22, text) elseif(#pmem > 1) then for i = 0, 4 do local k = getPartyMembersByVoc(cid, i) local vocvar = getVocationInfo(i).name text = text .. " " .. #k .. " " .. vocvar .. "\n" end local k2 = getPartyMembersByVoc(cid, 4) text = text .. "\n --High knights: " for _, kid in ipairs(k2) do local klvl = getPlayerLevel(kid) if(klvl >= highlevel) then count = count + 1 if(count <= 3) then text = text .. getPlayerName(kid) .. "[".. klvl .."]" .. (count < 3 and ", " or ".") end end end text = text .. "." end else text = "-- You are not in any party. -- " end elseif(words == "!guildcheck") then local gmem = getOnlineGuildMembers(cid) text = "-- Guild Check --\n" if(#gmem ~= 0) then local noneCount = 0 local g = {name = getPlayerGuildName(cid)} text = "[".. g.name .."] There are ".. #gmem .." players playing. " for _, gid in ipairs(gmem) do noneCount = noneCount + 1 text = text .. getPlayerName(gid) .. (noneCount == #gmem and "." or ", ") end local k2 = getPartyMembersByVoc(cid, 4) text = text .. "\n --High knights: " for _, kid in ipairs(k2) do local klvl = getPlayerLevel(kid) if(klvl >= highlevel) then count = count + 1 if(count <= 3) then text = text .. getPlayerName(kid) .. "[".. klvl .."]" .. (count < 3 and ", " or ".") end end end text = text .. "." else text = "You are not in a guild." end end return doPlayerSendTextMessage(cid, 22, text) endObs: Edite apenas onde estiver escrito.
agora em talkaction.xml adicione
Imagem:
Crédito
KylerXX
Editado Dezembro 26 por SkyDangerous