Here is a command useful to check who is in a certain posisition (temple, depot, etc...)
...data/talkactions/scripts/SCRIPT_NAME.lua
...data/talkactions/talkactions.xml
Here is an example:
...data/talkactions/scripts/SCRIPT_NAME.lua
LUA:
local positions =
{
["temple"] =
{
from = { x = 92, y = 114, z = 7 },
to = { x = 98, y = 120, z = 7 }
},
["depot"] =
{
from = { x = 81, y = 121, z = 7 },
to = { x = 84, y = 128, z = 7 }
},
["trainers"] =
{
from = { x = 92, y = 138, z = 7 },
to = { x = 96, y = 142, z = 7 }
}
}
local t = 0
local tmp = {}
function onSay(cid, words, param, channel)
local text = "Checking " .. param
if(param == "") then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.") and true end
if positions[param] then
for _, pid in ipairs(getPlayersOnline()) do
if isInArea(getCreaturePosition(pid), positions[param].from, positions[param].to) then
table.insert(tmp, pid)
end
end
text = text .. "\n" .. "Found " .. table.maxn(tmp) .. " players.\n"
for _, pid in ipairs(tmp) do
t = t + 1
text = text .. "\n" .. t .. ". " .. getCreatureName(pid) .. " [Level: " .. getPlayerLevel(pid) .. "][" .. getVocationInfo(getPlayerVocation(pid)).name .. "]"
end
doShowTextDialog(cid, 1948, text)
end
return true
end
...data/talkactions/talkactions.xml
LUA:
<talkaction log="yes" words="/check" access="4" event="script" value="SCRIPT_NAME.lua"/>
Here is an example:

Last edited: