[Talkaction] Guild Command
6/12/2015, 00:24
O comando checa:
- O total de membros que sua guild possui
- Quantos Players Tem online
- Mostra o nome e o Rank dos jogadores Online
Em lib/050-function adicione:
- Spoiler:
function CountGuildMembers(GuildName) -- function by vodkart
local count = 0
local lista = db.getResult("SELECT `name`, `rank_id` FROM `players` WHERE `rank_id` IN (SELECT `id` FROM `guild_ranks` WHERE `guild_id` = " .. getGuildId(GuildName) .. ");")
if(lista:getID() ~= -1) then
repeat count = count + 1 until not lista:next() lista:free() return count end
end
Em talkactions/script guildinformation.lua
- Spoiler:
- function onSay(cid, words, param, channel)
local players,str,GuildName = {},'',getPlayerGuildName(cid)
if getPlayerGuildId(cid) <= 0 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Você precisa estar em uma Guild.") return true end
for _, cid in pairs(getPlayersOnline()) do
if getPlayerGuildName(cid) == GuildName then
table.insert(players, cid)
end
end
str = str .. "Membros total da guild: "..CountGuildMembers(GuildName).." Players.\n\nExiste "..#players.." Players online na sua guild:\n\n"
for i = 1, #players do
str = str.."\n["..getPlayerName(players[i]).."]["..getPlayerGuildRank(players[i]).."]"
end
return doShowTextDialog(cid, 2533, str)
end
talkactions.xml
- Spoiler:
- <talkaction words="!guild" event="script" value="guildinformation.lua"/>
Permissões neste sub-fórum
Não podes responder a tópicos
|
|