SA-MP Forums Archive
[Tutorial] Moving Gates, Elevators Etc. - 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)
+--- Thread: [Tutorial] Moving Gates, Elevators Etc. (/showthread.php?tid=60960)

Pages: 1 2


[Tutorial] Moving Gates, Elevators Etc. - Snyper18 - 09.01.2009

Hello, Many people have asked me " Can you help me make a moving gate" So now i am showing a tutorial of how to make one.

Alright first, We need cords.
Step 1. Go to the place you want your gate to be, /save Gate
Step 2. Now go to the place where you want your gate to move to ( I usually make it move up. )
Step 3. Then get the Cords for when it moves back down.
Step 4. Go to your GTA SA File ( Located In ProgramFiles/Rockstargames/Grand Theft Auto GTA SA/ And search for Saved Positions.



Example code :

Quote:

First, add
( new elevator; ) Near the top of your script, I will be using the Object named "elevator" You can edit this.
Example : new elevator;

Quote:

Second,Get the cords of where your gate,elevator etc is. Make sure it's the cord of where it's closed.
Then add something like this, Put it under your Vehicle spawns/skins/objects- you pick.

Now it should look like this :
elevator = CreateObject( 2669 , -1489.413085 , 2624.577148 , 61.223720 , 0.000000 , 0.000000 , 358.000000 );
^ ^
| |
Is the object name Object id ( Now the wrest is the cords. Put yours in )

Quote:

And now the final step!

Put your command in under "OnPlayerCommandText" - Edit this command to your wishes.

if(strcmp(cmd, "/eup", true) == 0) { // Edit the /eup to your elevator command.
MoveObject(elevator,-1489.413085,2624.461914,84.440391,2.00); // Put your cords in here
SendClientMessage(playerid, COLOR_RED, "You are now going up, Please Wait."); // You dont alwas have to put this in, delete if wanted.
return 1;
}
if(strcmp(cmd, "/edown", true) == 0) { // Same deal as before
MoveObject(elevator,-1489.413085,2624.461914,60.960697,-2.00); // Same deal as before
SendClientMessage(playerid, COLOR_RED, "The Elevator is now comming, Please Wait."); // Same deal as before
return 1;
}

And Tada ! Your done. Enjoy your moving gates.
Please tell me if this helped you at all, If not i can explain better in a Pm etc.
- Hugs from Bruzer


Re: [Tutorial] Moving Gates, Elevators Etc. - g@k - 09.01.2009

Not bad ^^ , next time with OnPlayerToPoint


Re: [Tutorial] Moving Gates, Elevators Etc. - Snyper18 - 09.01.2009

Oh shoot! Forgot about that

But i find this way more simple for newbies .
Even for me!


Re: [Tutorial] Moving Gates, Elevators Etc. - flames - 09.01.2009

Its great to find tutorials rather then questions in this section.


Re: [Tutorial] Moving Gates, Elevators Etc. - Snyper18 - 09.01.2009

So true, Saves time, Makes people happy.


Re: [Tutorial] Moving Gates, Elevators Etc. - g@k - 09.01.2009

Yes .. but with OnPlayerToPoint , Not need to do some commands and lost time and it's the must for me , i think


Re: [Tutorial] Moving Gates, Elevators Etc. - Snyper18 - 09.01.2009

Like i said, Not all like it like that.


Re: [Tutorial] Moving Gates, Elevators Etc. - Nimphious - 09.01.2009

Quote:
Originally Posted by g@k
Yes .. but with OnPlayerToPoint , Not need to do some commands and lost time and it's the must for me , i think
Nope soz, the onplayertopoint is if you want everyone to be able to goto that object and it moves, what if you have a gate and you only want to be the person to get in


Re: [Tutorial] Moving Gates, Elevators Etc. - Snyper18 - 09.01.2009

Then set the team.
Of who can call the gate etc.


Re: [Tutorial] Moving Gates, Elevators Etc. - Jari - 14.01.2009

can you post for others object names, example for gates, if i dont want elevater


Re: [Tutorial] Moving Gates, Elevators Etc. - Snyper18 - 14.01.2009

https://sampwiki.blast.hk/wiki/Object_St...C_and_Barriers

EDIT : Gate ids , 969,971,974,975,976,980,985,986,987


Re: [Tutorial] Moving Gates, Elevators Etc. - Joe Staff - 15.01.2009

Quote:
Originally Posted by ssǝן‾ʎ
pawn Code:
CreateGate(model, xPos, yPos, zPos, xTarget, yTarget, zTarget);
Creating a gate (or elevator if you set the target up) using YSI.
burn


Re: [Tutorial] Moving Gates, Elevators Etc. - Snyper18 - 15.01.2009

Quote:
Originally Posted by SilentHuntR
Quote:
Originally Posted by ssǝן‾ʎ
pawn Code:
CreateGate(model, xPos, yPos, zPos, xTarget, yTarget, zTarget);
Creating a gate (or elevator if you set the target up) using YSI.
burn
Whats so burn about that, He's just explaining How his Program works..


Re: [Tutorial] Moving Gates, Elevators Etc. - Donny_k - 15.01.2009

Quote:
Originally Posted by ssǝן‾ʎ
pawn Code:
CreateGate(model, xPos, yPos, zPos, xTarget, yTarget, zTarget);
Creating a gate (or elevator if you set the target up) using YSI.
Is there something wrong with you today ? That's mighty short for one of your tutorials


Re: [Tutorial] Moving Gates, Elevators Etc. - Joe Staff - 15.01.2009

Quote:
Originally Posted by ssǝן‾ʎ
Quote:
Originally Posted by Donny
Quote:
Originally Posted by ssǝן‾ʎ
pawn Code:
CreateGate(model, xPos, yPos, zPos, xTarget, yTarget, zTarget);
Creating a gate (or elevator if you set the target up) using YSI.
Is there something wrong with you today ? That's mighty short for one of your tutorials
All my YSI tutorials are short because it's designed to be quick and easy to use .

Anyway, it wasn't a burn, he wrote a tutorial, I gave additional information for the tutorial, as I hope people do on mine.
That's not additional information, that's re-writing his tutorial


Re: [Tutorial] Moving Gates, Elevators Etc. - Snyper18 - 15.01.2009

No it's not, Stop post huntin buddy, it's pointless


Re: [Tutorial] Moving Gates, Elevators Etc. - Jari - 15.01.2009

Is there any need for define object, and can you paste tutorial for walls, and barries


Re: [Tutorial] Moving Gates, Elevators Etc. - Snyper18 - 15.01.2009

You mean how to make a Wall..? Just get the object ID and Put the cords of where you want it.


Re: [Tutorial] Moving Gates, Elevators Etc. - Jari - 15.01.2009

Quote:
Originally Posted by Bruzer18
You mean how to make a Wall..? Just get the object ID and Put the cords of where you want it.
ok,tnx, but is there any web site where is IDs and pictures of objects


Re: [Tutorial] Moving Gates, Elevators Etc. - Snyper18 - 15.01.2009

****** SAMP WIKI.