Hey there, im making a system for my otserver where when i say a talkaction like (!teleport Rob), i get teleported to a random of some specific positions, and "Rob" gets teleported to another position acording to the position i got teleported, this is what i cant get to work. Here is my code so far:
I need that if i get teleported to any of those positions, like {x = 533, y = 511, z = 6}, then "Rob" gets teleported to {x = 533, y = 511, z = 7}, if i get teleported to {x = 529, y = 515, z = 6}, then Rob gets teleported to another location, acording to the one i get teleported. Any help please? im new at this^_^
PHP:
function onSay(cid, words, param, channel)
local config = {
pos = {
{x = 533, y = 511, z = 6},
{x = 529, y = 515, z = 6},
{x = 537, y = 508, z = 6},
{x = 537, y = 515, z = 6},
{x = 529, y = 508, z = 6}
}
}
if
doTeleportThing(cid, config.pos[math.random(#config.pos)])
end
local ppos = getPlayerPosition(cid)
local parameter = string.explode(param, ",")
if(parameter[1] ~= nil) then
local pname = getPlayerByNameWildcard(parameter[1])
if(parameter[1] ~= nil) then
doTeleportThing(pname, ppos)
end
end
end
I need that if i get teleported to any of those positions, like {x = 533, y = 511, z = 6}, then "Rob" gets teleported to {x = 533, y = 511, z = 7}, if i get teleported to {x = 529, y = 515, z = 6}, then Rob gets teleported to another location, acording to the one i get teleported. Any help please? im new at this^_^