Hiho, I fould on forum talkaction which shows players online from your guild and it works, here is it:
But I want command which shows people from other guild online, for example !guildonline NameOfGuild
Can someone change it?
function onSay(cid, words, param)
local onlineMembers = {}
local playerGuild = getPlayerGuildId(cid)
if playerGuild == 0 then
return TRUE
end
for _, name in ipairs(getOnlinePlayers()) do
if getPlayerGuildId(getPlayerByName(name)) == playerGuild then
table.insert(onlineMembers, name)
end
end
if #onlineMembers == 0 then
doPlayerSendTextMessage(cid, 24, "There are no players online from your guild..")
else
local playersOnline = #onlineMembers
local tmp = ""
if(playersOnline > 1) then
local tmp = "(s)"
end
local header = playersOnline .. " player" .. tmp .. " online from your guild."
local str = ""
for i, string in ipairs(onlineMembers) do
str = "\n" .. str .. string .. "\n"
end
doPlayerPopupFYI(cid, header .. ".\n " .. str)
end
return LUA_NO_ERROR
end
But I want command which shows people from other guild online, for example !guildonline NameOfGuild
Can someone change it?