How to Make moving gate
#9

What? Okay, look. Here is the code for a moving gate...

pawn Code:
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...
pawn Code:
new Gate1;
As for the Gate1 object codes... You would need to add the variable. Like so.
pawn Code:
Gate1 = CreateObject(980,829.784,-2067.690,14.727,0.0,0.0,0.0);
As for the MoveObject, I will explain.
pawn Code:
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.
Reply


Messages In This Thread
How to Make moving gate - by candyboy - 13.03.2010, 17:28
Re: How to Make moving gate - by Scenario - 13.03.2010, 18:11
Re: How to Make moving gate - by mansonh - 13.03.2010, 18:25
Re: How to Make moving gate - by MaykoX - 13.03.2010, 18:27
Re: How to Make moving gate - by Deat_Itself - 13.03.2010, 18:30
Re: How to Make moving gate - by Correlli - 13.03.2010, 18:44
Re: How to Make moving gate - by Scenario - 13.03.2010, 19:53
Re: How to Make moving gate - by candyboy - 13.03.2010, 21:34
Re: How to Make moving gate - by Scenario - 13.03.2010, 22:46
Re: How to Make moving gate - by candyboy - 14.03.2010, 08:42

Forum Jump:


Users browsing this thread: 1 Guest(s)