will this work? i don't have time or resources to test
4 replies, posted
this is code, can someoen test it for me?
[lua]
function IsPlayerHere( ply, vector1, vector2)
local vector3 = ply:GetPos()
local x1 = vector1.x
local x2 = vector2.x
local y1 = vector1.y
local y2 = vector2.y
local y1 = vector1.z
local y2 = vector2.z
local functions = {}
local function f1()
for i=x1, i=x2 do
if vector3.x == i then
return true
end
end
end
local function f2()
for i=y1, i=y2 do
if vector3.y == i then
return true
end
end
end
local function f3()
for i=z1, i=z2 do
if vector3.z == i then
return true
end
end
end
functions[x] = f1()
functions[y] = f2()
functions[z] = f3()
if functions[x] and functions[y] and functions[z] then
return true
end
end
[/lua]
i can test it, but what is it supposed to do?
Whats the point of writing code if you dont have time to run it
The script wont work anyways, you got some stuff wrong in there like: functions[x] should be functions["x"] ? And shouldent you just call your functions instantly instead of writing them to a table?
What the hell. You could just do
[lua]
function IsPlayerHere( ply, v1, v2 )
local p = ply:GetPos()
return ( ( v1.x < p.x and p.x < v2.x ) and ( v1.y < p.y and p.y < v2.y ) and ( v1.z < p.z and p.z < v2.z ) )
end[/lua]
Sorry, you need to Log In to post a reply to this thread.