Castillo Posted July 13, 2012 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. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Phoenix-Roleplay Posted July 13, 2012 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. All kinds of feedback are welcome on all of my posts.
Castillo Posted July 13, 2012 Posted July 13, 2012 That'll not work. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Shidony Posted July 13, 2012 Author 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.
Castillo Posted July 13, 2012 Posted July 13, 2012 You have a custom function called: "setInPosition"? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
TwiX! Posted July 13, 2012 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. - Working on [php/HTML/Mysql/Lua/Java Scripts/Web Design/3D Modeling]
Shidony Posted July 13, 2012 Author 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.
Castillo Posted July 14, 2012 Posted July 14, 2012 You're welcome. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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