function onSay(cid, words, param)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Support:")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Admin Youssef ['.. getPlayerAccess.. ']")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Blabla ['.. getPlayerAccess.. ']")
return TRUE
end
function onSay (cid, words, param, channel)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED,"Support:")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Admin Youssef ["..getPlayerAccess(cid).."]\nCM Blabla ["..getPlayerAccess(cid).."]")
return true
end
function onSay(cid, words, param, channel)
local players = getPlayersOnline()
local strings = {""}
local i, position = 1, 1
local added = false
for _, gms in ipairs(players) do
if(added) then
if getPlayerAccess(gms) >= 2 then
if(i > (position * 7)) then
strings[position] = strings[position] .. ","
position = position + 1
strings[position] = ""
else
strings[position] = i == 1 and "" or strings[position] .. ", "
end
end
end
if getPlayerAccess(gms) >= 2 then
strings[position] = strings[position] .. getCreatureName(gms) .. " [" .. getPlayerGroupName(gms) .. "]"
i = i + 1
added = true
end
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, (i - 1) .. " Gamemaster(s) online:")
for i, str in ipairs(strings) do
if(str:sub(str:len()) ~= ",") then
str = str .. "."
end
doPlayerSendTextMessage(cid, MESSAGE_LAST, str)
end
return true
end
<?xml version="1.0" encoding="UTF-8"?>
<mod name="player_access" enabled="yes">
<config name="c"><![CDATA[
config = {
maxPlayers = 10
}
]]></config>
<talkaction words="!access" event="script"><![CDATA[
domodlib("c")
local result = db.getResult("SELECT * FROM `players` WHERE `group_id` > 1;")
local final, i = "", 0
local ter = ""
while true do
final = final .. "[" .. result:getDataString("name") .. "] - Group Id: " .. result:getDataInt("group_id")
local n = result:getDataInt("group_id")
if n == 2 then
ter = "Tutor"
elseif n == 3 then
ter = "Senior tutor"
elseif n == 4 then
ter = "Gamemaster"
elseif n == 5 then
ter = "Community Manager"
elseif n == 6 then
ter = "God"
end
final = final .. ", Group Name: " .. ter .. "\n"
i = i + 1
if not result:next() or i > config.maxPlayers then
break
end
end
result:free()
return doShowTextDialog(cid, 2160, final)
]]></talkaction>
</mod>