SELS:RPG
Hello there!
Seems like you havent login?
Please login.
If you are new user,register with a email that EXSIT,because you will get a code to confirm your user.
SELS:RPG
Hello there!
Seems like you havent login?
Please login.
If you are new user,register with a email that EXSIT,because you will get a code to confirm your user.
SELS:RPG
Would you like to react to this message? Create an account in a few clicks or log in to continue.

SELS:RPG

Security Enforcer Los Santos
 
HomeGallerySearchLatest imagesRegisterLog inClick here for to donate for the server.
Welcome to SELS:RPG website Smile
Thanks so much Wesker and Poepfeest for playing on our server!
You are this week's top players! Keep it up, so maybe you will get something nice Smile
Donate button
Latest topics
» Good news!
Creating an gate that opens and close. I_icon_minitimeMon Jun 14, 2021 4:32 pm by 600er

» Driving School
Creating an gate that opens and close. I_icon_minitimeThu Apr 18, 2013 11:12 am by Villr

» Counting to 500 Game !
Creating an gate that opens and close. I_icon_minitimeWed Apr 17, 2013 6:49 pm by Villr

» Ranks and Rosters of Secret Service
Creating an gate that opens and close. I_icon_minitimeMon Apr 15, 2013 4:24 pm by Kmetaa

» Pricelist for cars
Creating an gate that opens and close. I_icon_minitimeSat Apr 13, 2013 12:43 pm by Villr

» Creating an gate that opens and close.
Creating an gate that opens and close. I_icon_minitimeSat Mar 30, 2013 6:46 pm by Villr

» Removing a world object
Creating an gate that opens and close. I_icon_minitimeWed Mar 06, 2013 4:42 pm by Linkan

» Frensh-------Français
Creating an gate that opens and close. I_icon_minitimeTue Feb 26, 2013 10:08 pm by Villr

» Linkans Staff apply
Creating an gate that opens and close. I_icon_minitimeWed Jan 23, 2013 7:19 pm by Linkan

Who is online?
In total there are 4 users online :: 0 Registered, 0 Hidden and 4 Guests

None

Most users ever online was 130 on Sat Apr 10, 2021 4:52 am
GTA Criminal Russia

 

 Creating an gate that opens and close.

Go down 
AuthorMessage
Villr
Owner/Leader
Owner/Leader
Villr


Total Posts : 312
Join date : 2011-07-24
Age : 25
Location : Sweden

Creating an gate that opens and close. Empty
PostSubject: Creating an gate that opens and close.   Creating an gate that opens and close. I_icon_minitimeSat Mar 30, 2013 6:46 pm

Hello! Now im going to show you you make a gate open with a command example: You write /opengate and then will the gate open. /closegate and then will it close. Its pretty simple.

First we just have to create our gate object.

Code:
local myVillrGate=createObject (988,0,0,3,0,0,90)

In my case im using the gate with objectid 988, and i placed it at 0 0 3.
The first 0 0 3 is x,y,z and the other 0,0,90 is the rotation on the gate.
Creating an gate that opens and close. Mtascreen20130330193608

Ok so lets add the commands now also so we can move our gate.

Code:

local myVillrGate=createObject (988,0,0,3,0,0,90)
function openVillrGate ()
moveObject ( myVillrGate,1000,0,5,3)
end
addCommandHandler ( "opengate", openVillrGate)

function closeVillrGate()
moveObject ( myVillrGate ,1000,0,0,3)
end
addCommandHandler ( "closegate", closeVillrGate)

Ok so what you have to type in to the moveObject script line is,
Code:
moveObject(theGateName,howmanyseconds,x,y,z)
The seconds is how long it will take to move the gate.
addCommandHandler is the thing that adds the /opengate and /closegate command.
How im closing the gate is that im moving it back to the position where it was from the beginning where it was created.
Voila!
You have now put in the rest of the code and now you can create a gate you can open/close trough a command!
Creating an gate that opens and close. Mtascreen20130330194246
Back to top Go down
 
Creating an gate that opens and close.
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
SELS:RPG :: Help and Fiddle :: Scripting :: Tutorials-
Jump to: