darcioantonio
www.adventurerpg.com.br
- Joined
- Jul 30, 2013
- Messages
- 165
- Solutions
- 1
- Reaction score
- 4
- Location
- Brasil
- Twitch
- darcio_
- YouTube
- UCEXCOEw_dYchojHNz
Good morning, is there a talkaction that checks players in a particular area? with if it were an online
more !onlinearena.
Algo assim!
more !onlinearena.
Algo assim!
Lua:
function onSay(player, words, param, frompos, topos)
-- Local de Espera
local ConfigOnline = {
frompos = {x = 1370, y = 1028, z = 6}, -- Norte Esquerda Local de espera
topos = {x = 1374, y = 1032, z = 6} -- Sul Direita Local de espera
}
for a = ConfigOnline.frompos.x, ConfigOnline.topos.x do
for b = ConfigOnline.frompos.y, ConfigOnline.topos.y do
for c = 1, 6 do
pos = {x = a, y = b, z = c, stackpos = 255}
local hasAccess = pos
local players = pos
local playerCount = Game.getPlayerCount()--+69 -- spoofing
player:sendTextMessage(MESSAGE_INFO_DESCR, playerCount .. " players online.")
local i = 0
local msg = ""
for k, targetPlayer in ipairs(players) do
if hasAccess or not targetPlayer:isInGhostMode() then
if i > 0 then
-- msg = msg .. ", "
end
msg = msg .. targetPlayer:getName() .. ", "
i = i + 1
end
if i == 10 then
if k == playerCount then
msg = msg .. ""
else
msg = msg .. ""
end
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, msg)
-- msg = ""
i = 0
end
end
if i > 0 then
msg = msg .. "."
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, msg)
end
end
end
end
return false
end