DarkLink Posted July 13, 2011 Share Posted July 13, 2011 Guys I have problem here with timer Tryed setTimer(estaPertoActivaMines, 1000,0) , no error but didnt saw the mines Thanks, I am getting a bit tired, I always have problems, cant write something and put it work on 1st time setTimer(estaPertoActivaMines(),1000,0) function estaPertoActivaMines() local player = getLocalPlayer() if(getPedOccupiedVehicle(player) ~= false) then local vehicle = getPedOccupiedVehicle(player) if(getElementData(vehicle, 'lighton', false) == true) then for i, v in ipairs(getElementsByType('object')) do local x, y, z = getElementPosition(getLocalPlayer()) local x1, y1, z1 = getElementPosition(v) if getElementModel(v) == 3053 then if(getDistanceBetweenPoints3D ( x, y, z, x1, y1, z1 ) <= -- s8) --> then setElementDimension(v,0) end setObjectStatic(v, true) end end end end end Link to comment
BinSlayer1 Posted July 13, 2011 Share Posted July 13, 2011 setTimer(estaPertoActivaMines(),1000,0) should be : setTimer(estaPertoActivaMines,1000,0) Link to comment
DiSaMe Posted July 13, 2011 Share Posted July 13, 2011 And it still won't work unless you move setTimer line to the end. Now a nil value is passed to setTimer because function is created after setTimer call. Link to comment
BinSlayer1 Posted July 13, 2011 Share Posted July 13, 2011 i used a timer once and i called it before i defined the function and it worked Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now