Jump to content

attempt to call global xyz (a userdate value)


Recommended Posts

RsIUsyJ.jpg
 

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)

 

Link to comment

yes i did, sorry for the hurry-scurry :D 

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?

Link to comment
On 2017. 06. 17. at 00:40, Gordon_G said:
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?
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...