rusztamas Posted June 16, 2017 Posted June 16, 2017 function OBJECTS() if DOOR_1 or DOOR_2 then destroyElement (DOOR_1) end --Destroys previous elements. DOOR_1 = createObject (2949, -709.25128173828, 947.37493896484, 11.458323478699) --Creates a door, declared as DOOR_1. DOOR_2 = createObject (2949, -709.25128173828, 948.9, 11.458323478699) --Creates a door, declared as DOOR_2. setElementData (DOOR_1, "locked", true) --DOOR_1 is locked. setElementData (DOOR_2, "locked", false) --DOOR_2 is unlocked. setElementData (DOOR_1, "open", false) --DOOR_1 is closed. setElementData (DOOR_1, "open", false) --DOOR_2 is closed. end addEventHandler ("onResourceStart", getRootElement(), OBJECTS) Line 75 is the 8th line, 83 is the 16th: function ATTEMPT_LOCK_INTERACTION(CLIENT) if isElementWithinMarker (CLIENT, DOOR_1_MARKER) then if getElementData (DOOR_1, "locked") == false then if getElementData (DOOR_1 "open") == false then setElementData (DOOR_1, "locked", true) end elseif getElementData (DOOR_1, "locked") == true then if getElementData (DOOR_1 "open") == false then setElementData (DOOR_1, "locked", false) end end end if isElementWithinMarker (CLIENT, DOOR_2_MARKER) then if getElementData (DOOR_2, "locked") == false then if getElementData (DOOR_2 "open") == false then setElementData (DOOR_2, "locked", true) end elseif getElementData (DOOR_2, "locked") == true then if getElementData (DOOR_2 "open") == false then setElementData (DOOR_2, "locked", false) end end end end addCommandHandler ("ATTEMPT_LOCK_INTERACTION", ATTEMPT_LOCK_INTERACTION)
AfterAll14 Posted June 16, 2017 Posted June 16, 2017 (edited) "," between Door and "open" Edited June 16, 2017 by AfterAll14 1
pa3ck Posted June 16, 2017 Posted June 16, 2017 (edited) Not just that line actually, but on these lines 4, 8, 16, 20. You probably copy-pasted them. Edited June 16, 2017 by pa3ck 1
rusztamas Posted June 16, 2017 Author Posted June 16, 2017 yes i did, sorry for the hurry-scurry and i have an other question, i don't really want to make a new topic for that, because i post a lot of things here, so... on the image above, where the errors are as well, you can se a door. i tried to find a function i think i did not find the best function for that. i'd like to make a script for example i click the door, and it opens. what should i use for that?
Gordon_G Posted June 16, 2017 Posted June 16, 2017 https://wiki.multitheftauto.com/wiki/OnElementClicked https://wiki.multitheftauto.com/wiki/MoveObject 1
rusztamas Posted June 18, 2017 Author Posted June 18, 2017 On 2017. 06. 17. at 00:40, Gordon_G said: https://wiki.multitheftauto.com/wiki/OnElementClicked https://wiki.multitheftauto.com/wiki/MoveObject string mouseButton, string buttonState, player playerWhoClicked, float clickPosX, float clickPosY, float clickPosZ but for example if i am lucky and i can find that coordinate, (clickPosX, clickPosY, and clickPosZ) i will be never that lucky again to find that coordinate. or can i use this somehow in an other way?
pa3ck Posted June 18, 2017 Posted June 18, 2017 I'm not sure I understand that, what do you mean you would be lucky finding that position again? 1
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