Zalmon Posted July 11, 2011 Share Posted July 11, 2011 I am working on a script that takes you to the bank interior and dimension 1, and a marker that lets you go out of the interior and back to dimension 1, but the outBankMarker is un-findable bankMarker = createMarker ( 1654.1, -1654.76, 22.51, "cylinder", 2, 255, 255, 255, 255 ) outBankMarker = createMarker ( 389.82, 173.71, 1008.38, "cylinder", 2, 255, 255, 255, 255 ) function goIntoBank(hitElement, matchingDimension) if getElementType( hitElement ) == "player" and not getPedOccupiedVehicle( player ) then setPedFrozen( hitElement, true ) setElementDimension ( hitElement, 1 ) setElementInterior ( hitElement, 3, 386.59, 173.84, 1008.38 ) setPedFrozen( hitElement, false ) end end addEventHandler( "onMarkerHit", bankMarker, goIntoBank ) function goOutOfBank(hitElement, matchingDimension) if getElementType( hitElement ) == "player" and not getPedOccupiedVehicle( player ) then setPedFrozen( hitElement, true ) setElementDimension ( hitElement, 0 ) setElementInterior ( hitElement, 0, 1654.496, -1661.855, 22.51 ) setPedFrozen( hitElement, false ) end end addEventHandler( "onMarkerHit", outBankMarker, goOutOfBank ) function setDim() if ( getElementDimension ( outBankMarker ) == 0 ) then setElementDimension (outBankMarker , 1 ) end end addEventHandler( "onResourceStart", setDim ) Link to comment
Castillo Posted July 11, 2011 Share Posted July 11, 2011 "addEventHandler( "onResourceStart", setDim )"? That's wrong, you forgot something there. I suggest you to go read about event handlers again. Link to comment
Zalmon Posted July 11, 2011 Author Share Posted July 11, 2011 ... I still don't see my mistake I think I'm just being retarded right now... Link to comment
Castillo Posted July 11, 2011 Share Posted July 11, 2011 You forgot the attachedTo argument in the event handler, use this: addEventHandler( "onResourceStart", getResourceRootElement(getThisResource()), setDim ) Link to comment
Zalmon Posted July 11, 2011 Author Share Posted July 11, 2011 I thought u don't need that if you have no arguments in your function... Link to comment
Zalmon Posted July 11, 2011 Author Share Posted July 11, 2011 weird, it still didn't work... Link to comment
CowTurbo Posted July 11, 2011 Share Posted July 11, 2011 u have to add marker to the interior and dimension, use setElementInterior and setElementDimension for that. (outBankMarker... ) Link to comment
Zalmon Posted July 11, 2011 Author Share Posted July 11, 2011 Oh wow, easy mistake, I only put dimension, not interior thanks Cow 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