[Tutorial] Opening two gates At the same time
#1

Moving Objects 2 At the Same Time?


1 To create the objects (not teach here.)
Set 2 of the two objects at the New's.

Let's go:
New gatemove1;
new gatemove2;

Now In Ongamemodeinit:

gatemove1 = CreateObject(IDPORTAO,CoordX,CoordY,CoordZ,RotZ,Ro tZ,RotZ);
gatemove2 = CreateObject(IDPORTAO,CoordX,CoordY,CoordZ,RotZ,Ro tZ,RotZ);

Now function to move the objects!


if(strcmp(cmd, /objetosroyal, true) == 0)
{
if(IsPlayerConnected(playerid))
{
MoveObject(gatemove1,X,Y,Z,Velocidade); // gateopenpra1lado
MoveObject(gatemove2,X,Y,Z,Velocidade); //gateopenprooutro
}
return 1;
}
return 0;
if(strcmp(cmd, /fecharobjetosroyal, true) == 0)
{
if(IsPlayerConnected(playerid))
{
MoveObject(gatemove1,X,Y,Z,Velocidade); // Close^^
MoveObject(gatemove2,X,Y,Z,Velocidade); // Close^^
}
return 1;
}
return 0;

can also create a "SetTimer to automatically execute the function of the Close.
Reply
#2

There are lots of these tutorials on the forums.
And this one is useless because everyone who knows how to create a Moving Object,knows how to create 2 Moving Objects.
Have a break,have a kitkat
Reply
#3

Quote:
Originally Posted by [iPs]Bruno Tadeu
Посмотреть сообщение
Moving Objects 2 At the Same Time?


1 To create the objects (not teach here.)
Set 2 of the two objects at the New's.

Let's go:
New gatemove1;
new gatemove2;

Now In Ongamemodeinit:

gatemove1 = CreateObject(IDPORTAO,CoordX,CoordY,CoordZ,RotZ,Ro tZ,RotZ);
gatemove2 = CreateObject(IDPORTAO,CoordX,CoordY,CoordZ,RotZ,Ro tZ,RotZ);

Now function to move the objects!


if(strcmp(cmd, /objetosroyal, true) == 0)
{
if(IsPlayerConnected(playerid))
{
MoveObject(gatemove1,X,Y,Z,Velocidade); // gateopenpra1lado
MoveObject(gatemove2,X,Y,Z,Velocidade); //gateopenprooutro
}
return 1;
}
return 0;
if(strcmp(cmd, /fecharobjetosroyal, true) == 0)
{
if(IsPlayerConnected(playerid))
{
MoveObject(gatemove1,X,Y,Z,Velocidade); // Close^^
MoveObject(gatemove2,X,Y,Z,Velocidade); // Close^^
}
return 1;
}
return 0;

can also create a "SetTimer to automatically execute the function of the Close.
That is just a mess i'm sorry to say.
Before you do anything like this again, please read this:

https://sampforum.blast.hk/showthread.php?tid=65567
Reply
#4

To be honest, this is not even a tutorial...
Reply
#5

and use [ pawn ] & [ /pawn ]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)