X
Xikini
Guest
TFS 0.3.7
Just curious if this would work.
Not at home, and I want a better way to do it then the below method.
Code:
local locations = {
[{x = 1, y = 1, z = 1}] = {stuff = 1, stuff 2 = 2},
[{x = 2, y = 2, z = 2}] = {stuff = 1, stuff 2 = 2}
}
local p = getCreaturePosition(cid)
if locations[{x = p.x, y = p.y, z = p.z}] then
-- do stuff
end
Not at home, and I want a better way to do it then the below method.
Code:
local locations = {
[1] = {position = {x = 1, y = 1, z = 1}, stuff_1 = 1, stuff_2 = 2},
[2] = {position = {x = 2, y = 2, z = 2}, stuff_1 = 1, stuff_2 = 2}
}
local p = getCreaturePosition(cid)
for i = 1, #locations do
if locations[i].x == p.x and locations[i].y == p.y and locations[i].z == p.z then
-- do stuff
break
end
end