SA-MP Forums Archive
How to script an elevator in an aircraft carrier? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How to script an elevator in an aircraft carrier? (/showthread.php?tid=174299)



How to script an elevator in an aircraft carrier? - Alphos - 05.09.2010

I just mapped a carrier in my server, but I would like to have that elevator in the carrier, so I can drive my hydra upon it, and lift it on the upper deck, just to add more realism. A command like /elevator would be okay.


Thanks in advance.


Re: How to script an elevator in an aircraft carrier? - Flake. - 05.09.2010

you would need to use MoveObject


Re: How to script an elevator in an aircraft carrier? - Alphos - 05.09.2010

Quote:
Originally Posted by (*|Flake|*)
Посмотреть сообщение
you would need to use MoveObject
How? Do I need a whole piece of script for that, or is it easy?


Re: How to script an elevator in an aircraft carrier? - playbox12 - 05.09.2010

Its easy, you first map the position of the elevator, then you replace that object to the position where the elevator has to end, then you get have the two positions, then look up a tutorial for MoveObject, (usaly they use gates, but its the same thing).


Re: How to script an elevator in an aircraft carrier? - Alphos - 05.09.2010

Could you give me a link for the MoveObject tutorial? XD


Re: How to script an elevator in an aircraft carrier? - Matthew_Johnston - 05.09.2010

Heya, I Remember when I was Learning MoveObject Try Doing This.....
OVER "Ongameinit"
Make

new (name of Gate or Lift :P ) ;

Then Under "OnGamemodInit"

(Name of Gate or Lift) = CreateObject(information);


Then Make a Command like

/lift
{
MoveObject(name, Coordinates);
return 1;

-----------------------------------
all that will only work if you Know how to use Createobject :P


Re: How to script an elevator in an aircraft carrier? - Alphos - 05.09.2010

Quote:
Originally Posted by Matthew_Johnston
Посмотреть сообщение
Heya, I Remember when I was Learning MoveObject Try Doing This.....
OVER "Ongameinit"
Make

new (name of Gate or Lift :P ) ;

Then Under "OnGamemodInit"

(Name of Gate or Lift) = CreateObject(information);


Then Make a Command like

/lift
{
MoveObject(name, Coordinates);
return 1;

-----------------------------------
all that will only work if you Know how to use Createobject :P
I know how to insert coordinates and stuff, but could you explain me what part of it makes the object move, and is there a certain range of the object? I would like to have a certain 'range' on it, like, you only can start the elevator if you're near to it.


Re: How to script an elevator in an aircraft carrier? - iFrost - 05.09.2010

My guess is using IsPlayerInRange.


Re: How to script an elevator in an aircraft carrier? - Alphos - 05.09.2010

Could anybody post a good and clear tutorial for me? o.o


Re: How to script an elevator in an aircraft carrier? - iggy1 - 05.09.2010

Not a tutorial but its pretty clear how it works from the example.
https://sampwiki.blast.hk/wiki/MoveObject

You will find most of the things you need to know from the wiki.