Well i was browsin Request & support and saw that Cykotitan made this script for a guy there. So ALL Credits to him. I just beleive that some players will benefit from this. :thumbup:
So what the Script does is it allows you to check All Guilds on the server and players in the guild.
So what the Script does is it allows you to check All Guilds on the server and players in the guild.
LUA:
function onSay(cid, words, param, channel)
if param == '' then
local list = db.getResult("SELECT `name` FROM `guilds`;")
if(list:getID() ~= -1) then
local v = ''
repeat
v = v .. list:getDataString("name") .. "\n"
until not list:next()
list:free()
doShowTextDialog(cid, 2529, v)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "There are no guilds on this server.")
end
else
local id = getGuildId(param)
if id then
local list = db.getResult("SELECT `name`, `rank_id` FROM `players` WHERE `rank_id` IN (SELECT `id` FROM `guild_ranks` WHERE `guild_id` = " .. id .. ");")
if(list:getID() ~= -1) then
local v = ''
repeat
local rank = db.getResult("SELECT `name` FROM `guild_ranks` WHERE `id` = " .. list:getDataInt("rank_id") .. " LIMIT 1;")
v = v .. list:getDataString("name") .. " [" .. rank:getDataString("name") .. "]\n"
rank:free()
until not list:next()
list:free()
doShowTextDialog(cid, 2529, v)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "There are no players in this guild.")
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This guild doesn't exist.")
end
end
return true
end
Last edited: