Shidony Posted July 13, 2012 Share Posted July 13, 2012 (edited) Edited Edited November 17, 2012 by Guest Link to comment
Castillo Posted July 13, 2012 Share Posted July 13, 2012 1: I doubt it sets position, there's no such function: "setInPosition", it's "setElementPosition". 2: Your player argument is 'hitElement', but in "setElementFrozen" you're using "thePlayer". 3: "Unfreeze" function will never work, as you're not passing any player argument. Link to comment
Phoenix-Roleplay Posted July 13, 2012 Share Posted July 13, 2012 Try this, not tested. local BankEnter = createMarker(-2455.0500,503.7387,30.0776, "corona", 1.0, 255, 255, 255, 255) local BankExit = createMarker(324.01458740234, 110.85294342041, 1007.9656982422, "corona", 1.0, 255, 255, 255, 255) local thePlayer = getLocalPlayer() addEventHandler("onMarkerHit", BankEnter, function(hitElement) if (getElementType(hitElement) == "vehicle") then return end setElementFrozen( thePlayer, true ) setTimer( Unfreeze, 10000, 1, "Text" ) outputChatBox("You enter the bank", 255, 0, 0, false) setInPosition(hitElement, 325.62298583984, 114.32950592041, 1007.9656982422, 0) end) addEventHandler("onMarkerHit", BankExit, function(hitElement) if (getElementType(hitElement) == "vehicle") then return end setElementPosition(hitElement, -2452.828125, 504.38671875, 30.081373214722, 0) end) function Unfreeze() setElementFrozen( thePlayer, false ) end EDIT: If it's a client script, you will need to remove "local thePlayer = getLocalPlayer()" and add "thePlayer" into the correct areas. Link to comment
Shidony Posted July 13, 2012 Author Share Posted July 13, 2012 I change my script to: local BankEnter = createMarker(-2455.0500,503.7387,30.0776, "corona", 1.0, 255, 255, 255, 255) local BankExit = createMarker(324.01458740234, 110.85294342041, 1007.9656982422, "corona", 1.0, 255, 255, 255, 255) addEventHandler("onMarkerHit", BankEnter, function(hitElement) if (getElementType(hitElement) == "vehicle") then return end setElementFrozen ( hitElement, true ) setTimer( Unfreeze, 10000, 1, "Text" ) outputChatBox("You enter the bank", 255, 0, 0, false) setInPosition(hitElement, 325.62298583984, 114.32950592041, 1007.9656982422, 0) end) addEventHandler("onMarkerHit", BankExit, function(hitElement) if (getElementType(hitElement) == "vehicle") then return end setInPosition(hitElement, -2452.828125, 504.38671875, 30.081373214722, 0) end) function Unfreeze() setElementFrozen ( sourcePlayer, false ) end And i repeat that the problem is the freeze the setInPosition is working. Link to comment
Castillo Posted July 13, 2012 Share Posted July 13, 2012 You have a custom function called: "setInPosition"? Link to comment
Shidony Posted July 13, 2012 Author Share Posted July 13, 2012 Yes but the problem is not here. Link to comment
TwiX! Posted July 13, 2012 Share Posted July 13, 2012 local BankEnter = createMarker(-2455.0500,503.7387,30.0776, "corona", 1.0, 255, 255, 255, 255) local BankExit = createMarker(324.01458740234, 110.85294342041, 1007.9656982422, "corona", 1.0, 255, 255, 255, 255) addEventHandler("onMarkerHit", BankEnter, function(hitElement) if (getElementType(hitElement) == "vehicle") then return end setElementFrozen ( hitElement, true ) setTimer( Unfreeze, 10000, 1, hitElement ) outputChatBox("You enter the bank", 255, 0, 0, false) setElementPosition(hitElement, 325.62298583984, 114.32950592041, 1007.9656982422, 0) --or YOur function setInPosition end) addEventHandler("onMarkerHit", BankExit, function(hitElement) if (getElementType(hitElement) == "vehicle") then return end setElementPosition(hitElement, -2452.828125, 504.38671875, 30.081373214722, 0) --or YOur function setInPosition end) function Unfreeze(thePlayer) setElementFrozen ( thePlayer, false ) end Your errors is: 1: I doubt it sets position, there's no such function: "setInPosition", it's "setElementPosition".2: Your player argument is 'hitElement', but in "setElementFrozen" you're using "thePlayer". 3: "Unfreeze" function will never work, as you're not passing any player argument. Link to comment
Shidony Posted July 13, 2012 Author Share Posted July 13, 2012 i solved my problem, it was my setInPosition i forgot that i added a freeze and a timer Sorry for the inconvenience. 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