Jump to content

Doing a Gate Script


Eren97

Recommended Posts

Posted

Hey guys.

I am rlly helpless.

I made a Gate with gatemaker and now i have this code

<gate x="277.03125" y="189.408203125" z="1007.171875" rx="0" ry="0" rz="0" x2="280.03125" y2="189.408203125" z2="1007.171875" rx2="0" ry2="0" rz2="0" objectID="974" team="false" collisionx="272.1728515625" collisionY="183.5166015625" collisionZ="1009.171875" collisionSize="10" raising="0" interiorID="3"></gate> 

Where the HELLA fuck to put it in and HOW the hella fuck.

PLEASE help me.

i am rlly new here and to scripting/mapping.

Can i put it in a map too?or a lua script.

how to put it in map,how to put it in lua.

need fast answer pls.

Im very silly about MTA Scripting

Posted

If you made it with "gatemaker" resource, then why don't you read how it works? it must have some kind of documentation.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Just copy that line into "gates.xml" into "gatemaker" and restart the resource.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Unpack "gatemaker.zip" and open up "gates.xml", then copy your gate code into it.

Like this:

-- gates.xml:

<gates> 
<gate x="277.03125" y="189.408203125" z="1007.171875" rx="0" ry="0" rz="0" x2="280.03125" y2="189.408203125" z2="1007.171875" rx2="0" ry2="0" rz2="0" objectID="974" team="false" collisionx="272.1728515625" collisionY="183.5166015625" collisionZ="1009.171875" collisionSize="10" raising="0" interiorID="3"></gate> 
</gates> 
  

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Then what are you asking? you want to a script to use that gate but not gatemaker?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

i started gatemaker and did /addgate id and then i placed it and then pressed enter and then placed where it has to move and then enter and then where the collision area has to be...

and then the code were in that file.and NOW what to DO with THAT code???

Posted

As far as I know "gatemarker" uses teams to restrict gates, so you should be in a team to be able to open it.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

its gatemakeR and it uses,but if i dont give it a Team,it uses my Team as default.

But my question is how to put the code in a script,so it is seeable and usable

Posted

-- server side:

gateCol = createColTube(275.57169, 190.07436, 1006.17188, 2, 2.5) 
setElementInterior(gateCol, 3) 
gate = createObject(974, 277.03125, 189.408203125, 1007.171875) 
setElementInterior(gate, 3) 
  
addEventHandler("onColShapeHit",gateCol, 
function (hitElement) 
    moveObject(gate, 3000, 280.03125, 189.408203125, 1007.171875) 
    setTimer(moveObject,6000,1,gate,3000,277.03125, 189.408203125, 1007.171875) 
end) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Create a new resource in your "resources" folder and create two files:

First: script.lua

Then open it and copy this into it:

gateCol = createColTube(275.57169, 190.07436, 1006.17188, 2, 2.5) 
setElementInterior(gateCol, 3) 
gate = createObject(974, 277.03125, 189.408203125, 1007.171875) 
setElementInterior(gate, 3) 
  
addEventHandler("onColShapeHit",gateCol, 
function (hitElement) 
    moveObject(gate, 3000, 280.03125, 189.408203125, 1007.171875) 
    setTimer(moveObject,6000,1,gate,3000,277.03125, 189.408203125, 1007.171875) 
end) 

Save the file and close it.

Second: meta.xml

Then open it and copy this into it:

    

Save the file and close it.

And third (last step): type /refresh in-game (logged in as admin) or refresh in server console, then start the resource.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

thank you.

will try tmmrw.no time left.

And what if i want other numbers?i mean another position and else...

Edit: *what is what in the script.lua

Posted

Check the wiki arguments for these functions and you'll know which ones are the coordinates.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
gateCol = createColCircle(272.1728515625, 183.5166015625, 1009.171875, 10) 
setElementInterior(gateCol, 3) 
gate = createObject(974, 277.03125, 189.408203125, 1007.171875) 
setElementInterior(gate, 3) 
  
addEventHandler("onColShapeHit",gateCol, 
function (hitElement) 
    moveObject(gate, 280.03125, 189.408203125, 1007.171875) 
end) 

'hitElement' was used in moveObject instead of 'gate'.

Business System viewtopic.php?f=108&t=35797

Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726

SQLite Tutorial viewtopic.php?f=148&t=38203

Posted

Woops, my bad, thanks for seeing that JR10 :P.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Yes, sorry, I used the wrong colshape :P.

gateCol = createColTube(275.57169, 190.07436, 1006.17188, 2, 2.5) 
setElementInterior(gateCol, 3) 
gate = createObject(974, 277.03125, 189.408203125, 1007.171875) 
setElementInterior(gate, 3) 
  
addEventHandler("onColShapeHit",gateCol, 
function (hitElement) 
    moveObject(gate, 3000, 280.03125, 189.408203125, 1007.171875) 
    setTimer(moveObject,6000,1,gate,3000,277.03125, 189.408203125, 1007.171875) 
end) 

Now it works.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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