-
Posts
484 -
Joined
-
Last visited
Everything posted by isa_Khamdan
-
It's from the function source code local sm = {} sm.moov = 0 sm.object1, sm.object2 = nil, nil local function removeCamHandler () if(sm.moov == 1) then sm.moov = 0 removeEventHandler ( "onClientPreRender", getRootElement(), camRender ) end end local function camRender () local x1, y1, z1 = getElementPosition ( sm.object1 ) local x2, y2, z2 = getElementPosition ( sm.object2 ) setCameraMatrix ( x1, y1, z1, x2, y2, z2 ) end function smoothMoveCamera ( x1, y1, z1, x1t, y1t, z1t, x2, y2, z2, x2t, y2t, z2t, time ) if(sm.moov == 1) then return false end sm.object1 = createObject ( 1337, x1, y1, z1 ) sm.object2 = createObject ( 1337, x1t, y1t, z1t ) setElementAlpha ( sm.object1, 0 ) setElementAlpha ( sm.object2, 0 ) setObjectScale(sm.object1, 0.01) setObjectScale(sm.object2, 0.01) moveObject ( sm.object1, time, x2, y2, z2, 0, 0, 0, "InOutQuad" ) moveObject ( sm.object2, time, x2t, y2t, z2t, 0, 0, 0, "InOutQuad" ) addEventHandler ( "onClientPreRender", getRootElement(), camRender ) sm.moov = 1 setTimer ( removeCamHandler, time, 1 ) setTimer ( destroyElement, time, 1, sm.object1 ) setTimer ( destroyElement, time, 1, sm.object2 ) return true end That's the function I used to Remove the CamRender function hideLoginWindow() guiSetVisible(GUIEditor.window[1], false) showCursor(false) showChat(true) showPlayerHudComponent ( "all", true ) removeCamHandler () setCameraTarget ( getLocalPlayer() ) end addEvent("hideLoginWindow", true) addEventHandler("hideLoginWindow", getRootElement(), hideLoginWindow)
-
attemp to call global 'removeCamHandler'(a nill value)
-
stopObject No I mean how can I stop the whole function
-
It works One last question , how can I stop it?
-
Hmm can you help me to do it? this is the start position setCameraMatrix ( 2024.8813476563, 1185.5794677734, 131.04609680176 , 2025.7608642578, 1185.3765869141, 130.61557006836, 0, 70 ) And from here I want to to keep moving around SA no matter where
-
interpolateBetween Hmm I didn't understand how to get these floats
-
I set a Camera Matrix on a selected position. My question is how can I make it move around the area?
-
I am getting error with the source function [15:22:09] ERROR: xTStreetsOrganizer\Server.lua:13: attempt to perform arithmetic on local 'x2' (a nil value)
-
This won't be helpful , I don't want the Rotation of the element. I want to check the rotation of the camera and see if it is facing north or no.
-
The one that solidsnake gave me works but I don't know which number mean that the camera is facing north , south .. etc.
-
Hmm how do I know if the camera is facing north?
-
Dosen't work [19:04:11] ERROR: get\get.lua:8: attempt to concatenate local 'z1' (a nil value)
-
Why this code doesn't work? addCommandHandler( "get", function ( thePlayer ) local x, y, z, x1, y1, z1 = getCameraMatrix ( thePlayer ) outputChatBox( x , y , z , x1 , y1 , z1 , thePlayer) end )
-
Thanks a lot
-
How can I make it output the message when the timer finish and the vehicle is destroyed?
-
I need to know how this function is called. function DSC( element ) it start on colshapehit function DSC( element ) if ( isElement(element) and getElementType (element) == "vehicle" ) and not ( getElementModel ( element ) == 431 ) then if isElementWithinColShape ( element, LineLS ) then timers [ element ] = setTimer ( Destroy , 6500, 0, element ) timers [ element ] = setTimer ( DestroyLS , 500, 0, element ) end end if ( isElement(element) and getElementType (element) == "vehicle" ) and not ( getElementModel ( element ) == 431 ) then if isElementWithinColShape ( element, LineRS ) then timers [ element ] = setTimer ( Destroy , 6500, 0, element ) timers [ element ] = setTimer ( DestroyRS , 500, 0, element ) end end end addEventHandler ( "onColShapeHit", resourceRoot, DSC )
-
Thanks it's working now but what about the outputchatbox? I want it for the player who triggered the function only
-
if isElementWithinColShape ( element, LineRS ) and not (z > 90) and not (z < 270) and isTimer ( Check [ element ] ) then killTimer ( Check [ element ] ) outputChatBox ( "* Check", root, 255, 0, 0, true )
-
It doesn't kill timer if the rotation changed while the timer is running.
-
That's won't help I just want to fix my code
-
Hmm what about this function? It dose destroy the vehicle but killTimer doesn't work function DestroyRS( element ) if ( isElement(element) and getElementType (element) == "vehicle" ) and not ( getElementModel ( element ) == 431 ) then local x,y,z = getElementRotation ( element ) if isElementWithinColShape ( element, LineRS ) and (z > 90) and (z < 270) then Check [ element ] = setTimer ( destroyElement , 4000, 1, element ) if isElementWithinColShape ( element, LineRS ) and not (z > 90) and not (z < 270) and isTimer ( Check [ element ] ) then killTimer ( Check [ element ] ) outputChatBox ( "* Check", root, 255, 0, 0, true ) end end end end This Function will be triggered every 1 second to check for the rotation and destroy but I want it that if the rotation changed while the timer is running then it will be destroyed. I have another function like with different rotation and it's working fine but this doesn't work well and I do not know what is the reason
-
Hmm what about this function? It dose destroy the vehicle but killTimer doesn't work function DestroyRS( element ) if ( isElement(element) and getElementType (element) == "vehicle" ) and not ( getElementModel ( element ) == 431 ) then local x,y,z = getElementRotation ( element ) if isElementWithinColShape ( element, LineRS ) and (z > 90) and (z < 270) then Check [ element ] = setTimer ( destroyElement , 4000, 1, element ) if isElementWithinColShape ( element, LineRS ) and not (z > 90) and not (z < 270) and isTimer ( Check [ element ] ) then killTimer ( Check [ element ] ) outputChatBox ( "* Check", root, 255, 0, 0, true ) end end end end
-
function DestroyRS( element ) if ( isElement(element) and getElementType (element) == "vehicle" ) and not ( getElementModel ( element ) == 431 ) then local x,y,z = getElementRotation ( element ) if isElementWithinColShape ( element, LineRS ) and (z >= 90) and (z <= 270) then outputChatBox ( "* Destroyed", source, 255, 0, 0, true ) destroyElement( element ) end end end function DSC( element ) if ( isElement(element) and getElementType (element) == "vehicle" ) then if ( isElementWithinColShape( element, LineLS ) ) then DestroyT [ element ] = setTimer ( Destroy , 10000, 0, element ) LST [ element ] = setTimer ( DestroyLS , 5000, 0, element ) end end if ( isElement(element) and getElementType (element) == "vehicle" ) then if ( isElementWithinColShape( element, LineRS ) ) then DestroyT [ element ] = setTimer ( Destroy , 10000, 0, element ) RST [ element ] = setTimer ( DestroyRS , 5000, 0, element ) end end end Can you tell me how can I fix it?