PDA

View Full Version : How to Make moving gate


candyboy
13/03/2010, 05:28 PM
How to Make moving gate ?

Scenario
13/03/2010, 06:11 PM
Use the search feature, there are about 10 tutorials on doing that.

mansonh
13/03/2010, 06:25 PM
Yep, there are tones of tutorials, both on the samp wiki and on the forums.
There are also some ready made filterscripts, for both setting up gates to move, and to auto create gates.

Infact I am currently making an inlcude that will both create gates, and allow full control over them :)
I will release it a lot later once I have finished and had it running on our server for a while.

MaykoX
13/03/2010, 06:27 PM
Use the search feature, there are about 10 tutorials on doing that.


Instead of saying to him use search feature and doing noting try searching and posting the link here : http://forum.sa-mp.com/index.php?topic=158928.0 and than tell him to NEXT time use the search before posting. So here is the link : http://forum.sa-mp.com/index.php?topic=158928.0

Deat_Itself
13/03/2010, 06:30 PM
Use the search feature, there are about 10 tutorials on doing that.


Instead of saying to him use search feature and doing noting try searching and posting the link here : http://forum.sa-mp.com/index.php?topic=158928.0 and than tell him to NEXT time use the search before posting. So here is the link : http://forum.sa-mp.com/index.php?topic=158928.0
thats right desicion and btw he is fully new to SAMP.As you can see that this is his first post

Correlli
13/03/2010, 06:44 PM
thats right desicion and btw he is fully new to SAMP.As you can see that this is his first post


Maybe he has a new account on the forum and that doesn't mean he's new to SA:MP.

Scenario
13/03/2010, 07:53 PM
Exactly, but he should have read the rules before posting too. Which state, "Use the search feature, before posting".

candyboy
13/03/2010, 09:34 PM
Am new to sa-mp and the reply from mar.... is not working wrong pawn code.so plz help me by anyone post

Scenario
13/03/2010, 10:46 PM
What? Okay, look. Here is the code for a moving gate...

public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/ah3open", true)==0)
{
SendClientMessage(playerid, COLOR_BLUE, "The front gate has opened. Welcome Admin!");
MoveObject(Gate1, 829.798,-2067.799,8.735, 3.0);
return 1;
}
if(strcmp(cmdtext, "/ah3close", true)==0)
{
SendClientMessage(playerid, COLOR_BLUE, "The front gate has closed. Goodbye!");
MoveObject(Gate1,829.784,-2067.690,14.727);
return 1;
}
}
return 1;
}

You must have the gate object codes, you have to have the code when it is closed, and when it is opened.
As you can use common sense the /ah3open moves the gate from closed position, to open. So use your cords accordingly. Vice versa with the close command.

Gate1 is a variable... So at the top of your script, you would need...
new Gate1;

As for the Gate1 object codes... You would need to add the variable. Like so.
Gate1 = CreateObject(980,829.784,-2067.690,14.727,0.0,0.0,0.0);

As for the MoveObject, I will explain.
MoveObject(Gate1, 829.798,-2067.799,8.735, 3.0);

Gate1 is the variable, the next three codes, (829.798,-2067.799,8.735) are the XYZ cords of the gate in either opened or closed position. The last code, (3.0) is the speed the gate will open/close.

To find more information on this topic, either PM me, or use the Wiki SA:MP page. You could ALSO use the SEARCH function on this forum.

*Read the rules too, since you are new to the forums... If you need help, PM a moderator, or someone like me.

candyboy
14/03/2010, 08:42 AM
Ntechstudios iam exceed 5 limit of message so iam replying in this !

i need two things one moving

and private car whn anyone took it should say "this car is reserverd for admin candyboy"

only for my cars !

Scenario
14/03/2010, 08:44 AM
Ntechstudios iam exceed 5 limit of message so iam replying in this !

i need two things one moving

and private car whn anyone took it should say "this car is reserverd for admin candyboy"

only for my cars !


Okay. PM me in a few hours, because it is really early in the morning here, and I need to go to sleep. I will help you then. I the mean time, add me on MSN, we will chat tomorrow...

MaykoX
14/03/2010, 08:45 AM
Ntechstudios iam exceed 5 limit of message so iam replying in this !

i need two things one moving

and private car whn anyone took it should say "this car is reserverd for admin candyboy"

only for my cars !


Tutorial for Private Cars : http://forum.sa-mp.com/index.php?topic=116016.0
Really Simple Tutorial for Gates : http://forum.sa-mp.com/index.php?topic=66575.0

Hope this helped :P And use this : http://forum.sa-mp.com/index.php?action=search;advanced before posting next time again.

candyboy
14/03/2010, 08:46 AM
i added you

Andy_McKinley
14/03/2010, 08:51 AM
I do want to explain how to make a moving gate (and not just redirecting him to a link -.-)!

Example: Area51

Alright, if you are using MTA MapEditor, put a gate somewhere you want. Then save it.
Then move the object where you want it and then save as a new map.

Go to the unmoved map file at Program Files/MTA San Andreas/Server/Deathmatch/Resources/nameofyourmap

open it, copy and past it to www.convertffs.com and convert it.

Put this above your script:

new gate1;

The object; gate1 = CreateObject();

Now you can make the moving gate with a strcmp command. But first you have to go to the moved gate map (you saved as). You don't need to convert it, if you open the MAP-file you will see the object and search for the X,Y,Z pos (very simple). And put it here:

if (strcmp("/a51gate", cmdtext, true, 10) == 0)
{
MoveObject(gate1, X, Y, Z (remove last 2 numbers), speed);
return 1;
}

If you want a close command, get the unmoved gate X, Y, Z pos (the one you converted) and do the same! :)

I hope this helped you!

Regards,
Andy McKinley

candyboy
18/03/2010, 11:37 PM
Thnx :P

KP2
14/09/2012, 03:50 PM
Can we have a timer for gates? If so please post it here