Jump to content

Moving Gate/Hit marker (house)


DonPro

Recommended Posts

Posted

Hey people. im up for make maps and maby a server and need help to make a Moving gate, and a marker to transport from outside the house and into the house (building) can anyone maby make one for me and tell me what to put into it? i need it realy fast.

Posted

ok you can use

for the moving gate:

Event 'onMarkerHit' 
createMarker 
createObject -- for the gate 
moveObject -- when the player hit the marker the gate move 

for the house:

Event 'onMarkerHit' 
createMarker 
setElementPosition -- to make the player who hit the marker enter the house 
setElementInterior -- if the house in interior ! 

Posted
ok you can use

for the moving gate:

Event 'onMarkerHit' 
createMarker 
createObject -- for the gate 
moveObject -- when the player hit the marker the gate move 

for the house:

Event 'onMarkerHit' 
createMarker 
setElementPosition -- to make the player who hit the marker enter the house 
setElementInterior -- if the house in interior ! 

Bro last time i did this i had a bigger script for the moving gate! :P can you show me a bigger and where i can place the (location) of the gate and the interior marker in another script? :P pleas

Posted

will, try this :

local marker = createMarker(x,y,z, "cylinder", 5, 255, 0, 0) 
local object = createObject(980, x,y,z) 
addEventHandler("onMarkerHit", marker, 
 function () 
 moveObject(object, 2000, x,y,z) 
 end 
) 
  
addEventHandler("onMarkerLeave", marker, 
 function () 
 moveObject(object, 2000, x,y,z) -- move the gate back ! 
end 
) 

local marker = createMarker(x,y,z, "cylinder", 1.5, 255, 0, 0) 
addEventHandler("onMarkerHit", marker, 
 function (player) 
 setElementPosition(player, x,y,z) 
 setElementInterior(player, number) -- change number to the house number ! 
end 
) 

Posted
will, try this :
local marker = createMarker(x,y,z, "cylinder", 5, 255, 0, 0) 
local object = createObject(980, x,y,z) 
addEventHandler("onMarkerHit", marker, 
 function () 
 moveObject(object, 2000, x,y,z) 
 end 
) 
  
addEventHandler("onMarkerLeave", marker, 
 function () 
 moveObject(object, 2000, x,y,z) -- move the gate back ! 
end 
) 

local marker = createMarker(x,y,z, "cylinder", 1.5, 255, 0, 0) 
addEventHandler("onMarkerHit", marker, 
 function (player) 
 setElementPosition(player, x,y,z) 
 setElementInterior(player, number) -- change number to the house number ! 
end 
) 

Alraight thanksbro! :) i will try! ^^

Posted
will, try this :
local marker = createMarker(x,y,z, "cylinder", 5, 255, 0, 0) 
local object = createObject(980, x,y,z) 
addEventHandler("onMarkerHit", marker, 
 function () 
 moveObject(object, 2000, x,y,z) 
 end 
) 
  
addEventHandler("onMarkerLeave", marker, 
 function () 
 moveObject(object, 2000, x,y,z) -- move the gate back ! 
end 
) 

local marker = createMarker(x,y,z, "cylinder", 1.5, 255, 0, 0) 
addEventHandler("onMarkerHit", marker, 
 function (player) 
 setElementPosition(player, x,y,z) 
 setElementInterior(player, number) -- change number to the house number ! 
end 
) 

lol it wont work :P

local marker = createMarker(2774.3999023438,-2418.1000976563,12.300000190735, "cylinder", 7, 0, 0, 255, 0) 
local object = createObject(10182, 2774.1999511719,-2417.8999023438,14.39999961853) 
addEventHandler("onMarkerHit", marker, 
 function () 
 moveObject(object, 2000, 2774.1999511719,-2417.8999023438,16.89999961853) 
 end 
) 
  
addEventHandler("onMarkerLeave", marker, 
 function () 
 moveObject(object, 2000, 2774.1999511719,-2417.8999023438,14.39999961853,) -- move the gate back ! 
end 
) 

Posted

try this:

    local marker = createMarker(2774.49,-2418.1,12.3, "cylinder", 7, 0, 0, 255, 0) 
    local object = createObject(10182, 2774.29,-2417.99,14.49) 
    addEventHandler("onMarkerHit", marker, 
     function () 
     moveObject(object, 2000, 2774.29,-2417.99,16.99) 
     end 
    ) 
      
    addEventHandler("onMarkerLeave", marker, 
     function () 
     moveObject(object, 2000, 2774.2,-2417.99,14.4) 
    end 
    ) 

Posted
try this:
    local marker = createMarker(2774.49,-2418.1,12.3, "cylinder", 7, 0, 0, 255, 0) 
    local object = createObject(10182, 2774.29,-2417.99,14.49) 
    addEventHandler("onMarkerHit", marker, 
     function () 
     moveObject(object, 2000, 2774.29,-2417.99,16.99) 
     end 
    ) 
      
    addEventHandler("onMarkerLeave", marker, 
     function () 
     moveObject(object, 2000, 2774.2,-2417.99,14.4) 
    end 
    ) 

Hmm no error ;S i made a Map in this Resource folder and puted in this map with the script in. OH OH OH! now i know the problem! last time i had a META also! so this is the LUA right?

Posted
try this:
    local marker = createMarker(2774.49,-2418.1,12.3, "cylinder", 7, 0, 0, 255, 0) 
    local object = createObject(10182, 2774.29,-2417.99,14.49) 
    addEventHandler("onMarkerHit", marker, 
     function () 
     moveObject(object, 2000, 2774.29,-2417.99,16.99) 
     end 
    ) 
      
    addEventHandler("onMarkerLeave", marker, 
     function () 
     moveObject(object, 2000, 2774.2,-2417.99,14.4) 
    end 
    ) 

Still not working :/ i tryed to change some shit to but yeah not working the Meta and Lua file is no errors and no errors in the files :/

Posted
try this:
    local marker = createMarker(2774.49,-2418.1,12.3, "cylinder", 7, 0, 0, 255, 0) 
    local object = createObject(10182, 2774.29,-2417.99,14.49) 
    addEventHandler("onMarkerHit", marker, 
     function () 
     moveObject(object, 2000, 2774.29,-2417.99,16.99) 
     end 
    ) 
      
    addEventHandler("onMarkerLeave", marker, 
     function () 
     moveObject(object, 2000, 2774.2,-2417.99,14.4) 
    end 
    ) 

Hmm no error ;S i made a Map in this Resource folder and puted in this map with the script in. OH OH OH! now i know the problem! last time i had a META also! so this is the LUA right?

Dude do you know scripting at all? you need to place a code into the meta and load it, just start reading imo..

https://wiki.multitheftauto.com/wiki/Sc ... troduction

Posted
try this:
    local marker = createMarker(2774.49,-2418.1,12.3, "cylinder", 7, 0, 0, 255, 0) 
    local object = createObject(10182, 2774.29,-2417.99,14.49) 
    addEventHandler("onMarkerHit", marker, 
     function () 
     moveObject(object, 2000, 2774.29,-2417.99,16.99) 
     end 
    ) 
      
    addEventHandler("onMarkerLeave", marker, 
     function () 
     moveObject(object, 2000, 2774.2,-2417.99,14.4) 
    end 
    ) 

Hmm no error ;S i made a Map in this Resource folder and puted in this map with the script in. OH OH OH! now i know the problem! last time i had a META also! so this is the LUA right?

Dude do you know scripting at all? you need to place a code into the meta and load it, just start reading imo..

https://wiki.multitheftauto.com/wiki/Sc ... troduction

i have done some scripts before but i dont remember some about it :P

Posted
try this:
    local marker = createMarker(2774.49,-2418.1,12.3, "cylinder", 7, 0, 0, 255, 0) 
    local object = createObject(10182, 2774.29,-2417.99,14.49) 
    addEventHandler("onMarkerHit", marker, 
     function () 
     moveObject(object, 2000, 2774.29,-2417.99,16.99) 
     end 
    ) 
      
    addEventHandler("onMarkerLeave", marker, 
     function () 
     moveObject(object, 2000, 2774.2,-2417.99,14.4) 
    end 
    ) 

Hmm no error ;S i made a Map in this Resource folder and puted in this map with the script in. OH OH OH! now i know the problem! last time i had a META also! so this is the LUA right?

Dude do you know scripting at all? you need to place a code into the meta and load it, just start reading imo..

https://wiki.multitheftauto.com/wiki/Sc ... troduction

the only problem i got now is that... the "GATE" wont show ingame i have started it and all running fine but it wont show ingame so yeah maby i should change object or something? or any problems?

Posted

try this

the code:

        local marker = createMarker(2774.49,-2418.1,12.3, "cylinder", 7, 0, 0, 255, 0) 
        local object = createObject(10182, 2774.29,-2417.99,14.49) 
        addEventHandler("onMarkerHit", marker, 
         function () 
         moveObject(object, 2000, 2774.29,-2417.99,16.99) 
         end 
        ) 
          
        addEventHandler("onMarkerLeave", marker, 
         function () 
         moveObject(object, 2000, 2774.2,-2417.99,14.4) 
        end 
        ) 

the meta:

    "" description="" type="script" version="1.0" /> 
    

Posted
try this

the code:

        local marker = createMarker(2774.49,-2418.1,12.3, "cylinder", 7, 0, 0, 255, 0) 
        local object = createObject(10182, 2774.29,-2417.99,14.49) 
        addEventHandler("onMarkerHit", marker, 
         function () 
         moveObject(object, 2000, 2774.29,-2417.99,16.99) 
         end 
        ) 
          
        addEventHandler("onMarkerLeave", marker, 
         function () 
         moveObject(object, 2000, 2774.2,-2417.99,14.4) 
        end 
        ) 

the meta:

    "" description="" type="script" version="1.0" /> 
    

okay i got it to work now! :D and im on my another gate now.. and how can change rotation on the gate? ^^ i tryet write (0,0,90) back of the location! but that didnt work :P

Posted
try this:
    local marker = createMarker(2774.49,-2418.1,12.3, "cylinder", 7, 0, 0, 255, 0) 
    local object = createObject(10182, 2774.29,-2417.99,14.49) 
    addEventHandler("onMarkerHit", marker, 
     function () 
     moveObject(object, 2000, 2774.29,-2417.99,16.99) 
     end 
    ) 
      
    addEventHandler("onMarkerLeave", marker, 
     function () 
     moveObject(object, 2000, 2774.2,-2417.99,14.4) 
    end 
    ) 

or forget it i was stupid.. :) haha i was restart the wrong file and write in wrong LUA! :P haha so i see now its working i find out how! :D thanks anyway! ^^

Posted
try this

the code:

        local marker = createMarker(2774.49,-2418.1,12.3, "cylinder", 7, 0, 0, 255, 0) 
        local object = createObject(10182, 2774.29,-2417.99,14.49) 
        addEventHandler("onMarkerHit", marker, 
         function () 
         moveObject(object, 2000, 2774.29,-2417.99,16.99) 
         end 
        ) 
          
        addEventHandler("onMarkerLeave", marker, 
         function () 
         moveObject(object, 2000, 2774.2,-2417.99,14.4) 
        end 
        ) 

the meta:

    "" description="" type="script" version="1.0" /> 
    

a last problem! :D hehe im now making this interior and it works when i hit the marker FROM the base to the interior but not back! so yeah

local marker = createMarker(2715.19,-2537.69,14.5, "arrow", 1, 239, 213, 0) 
addEventHandler("onMarkerHit", marker, 
 function (player) 
 setElementPosition(player, 2541.7,-1304.01,1024.07) 
 setElementInterior(player, 2) -- change number to the house number ! 
end 
) 

Posted
What do you mean by "not back"?

i hit the marker and i end up in the place i want to (Place = interior) but when i try hit the marker in the interior i cant get back to the base aigen! :P

Posted
And you did place a marker in the interior?

no create marker is down in the base not in the interior? :P hmm i dont know the problem in it ;S

Posted
And you did place a marker in the interior?

no create marker is down in the base not in the interior? :P hmm i dont know the problem in it ;S

A marker deploys "onClientMarkerHit" at that marker at that place, it wont do anything to the location ur going IF you are, to come back you should create a marker at the destination (not exactly same at it will create a loop) but close to go back.

Posted
Just saying, you're not going to learn anything if you're asking other people to do it for you.

im learning much dude, they tell me what to do and i try figger out by my self how to do it. but i have read some about scripting to! :P thanks to you all! :D

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...