function onSay(cid, words, param, channel)
local config = {
groupID = 6, -- Protect GroupID 1,2,3,4,5,6 = GOD
carlin = { x = 32360, y = 31782, z = 7 },
venore = { x = 32957, y = 32076, z = 7 },
edron = { x = 33217, y = 31814, z = 8 }
};
for _, cid in ipairs(getPlayersOnline()) do
if (getPlayerGroupId(cid) == config.groupID) then
if(param == '') then
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORK_YELLOW)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "HELP: Use !tpall x,y,z or !tpall carlin or !tpall venore or !tpall edron.")
return TRUE
end
for _, cid in ipairs(getPlayersOnline()) do
if (getPlayerGroupId(cid) < config.groupID) then
if(param == 'carlin') then
doTeleportThing(cid, config.carlin)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "All players have been teleported to carlin.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORK_YELLOW)
elseif(param == 'venore') then
doTeleportThing(cid, config.venore)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "All players have been teleported to venore.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORK_YELLOW)
elseif(param == 'edron') then
doTeleportThing(cid, config.edron)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "All players have been teleported to edron.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORK_YELLOW)
else
local t = string.explode(param, ",")
doTeleportThing(cid, { x = t[1], y = t[2], z = t[3] } )
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "All players have been teleported to the coords [X:"..t[1].."], [Y:"..t[2].."], [Z:"..t[3].."]")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORK_YELLOW)
end
end
end
end
end
return TRUE
end