Dantarrix
Member
Lua:
function onSay(cid, words, param, channel)
local param = string.explode(param, ",")
local params = {
["temple"] = {x=159, y=387, z=6},
["depot"] = {x=, y=, z=}
}
if (param[1] == nil) then
doPlayerSendCancel(cid, "You need to specificate a place or coordinates.")
return true
end
if not(isNumber(param[1])) then
param = string.lower(param)
for k, v in pairs(params) do
if (k[param]) then
doTeleportThing(cid, v)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "All players have been teleported to ".. k .. ".")
doBroadcastMessage("All players have been teleported to ".. k .." by " .. getCreatureName(cid) .. ".")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)
else
doPlayerSendCancel(cid, "Place does not exist.")
end
end
else
if ((param[2] == nil) then
doPlayerSendCancel(cid, "You necesarily need x and y coordinates.")
return true
end
local z = param[3]
if z == nil then
z = 7
end
local y = param[2]
local x = param[1]
for _, pid in ipairs(getPlayersOnline()) do
doTeleportThing(pid, {x=x, y=y, z=z})
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "All players have been teleported to x=".. x ..", y=".. y ..", z=".. z ..".")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)
oBroadcastMessage("All players have been teleported to x=".. x ..", y=".. y ..", z=".. z .." by " .. getCreatureName(cid) .. ".")
end
end
return true
end
The script should tp all conected players to a place, this place could be pre defined, like the temple or depot, or the god can say like /tpall 100, 100, 3 and it tps there all players..... If the god doesnt says the z coordinate, this should be 7 by default.... Thank you