SA-MP Forums Archive
[Tutorial] [TuT]How TO MAke Moving Object - 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: Tutorials (https://sampforum.blast.hk/forumdisplay.php?fid=70)
+---- Thread: [Tutorial] [TuT]How TO MAke Moving Object (/showthread.php?tid=159604)

Pages: 1 2


[TuT]How TO MAke Moving Object - Aleluja - 13.07.2010

Hello People
My name is Dino in RL
Tonight ((xD)) I going to show you how to make a Moving Object
Let Start
1
pawn Код:
new object;
pawn Код:
forward close();
2
pawn Код:
public OnGameModeInit()
Put your object
pawn Код:
public OnGameModeInit()
{
     object = CreateObject(780,1559.642,-1427.411,45.146,0.0,0.0,90.000);
     return 1;
}
3 Find your coordinate when gate is open end then put: OnPlayerCommandText(playerid, cmdtext[]) :
pawn Код:
if (strcmp("/open", cmdtext, true, 10) == 0)
{
       MoveObject(object,1587.690,-1437.827,4.755, 2.00);
       SetTimer("close", 7000, 0);//gate will be  closed for 7 seconds
       SendClientMessage(playerid,GREEN,"You are opening a Gate, and will be closed automaticly..");
       return 1;}
}
pawn Код:
public close()
{
    MoveObject(object,1549.612,-1127.641,45.126, 3.00);
    return 1;
}
If you copy this Coordinate this is not going to work to you
Sorry for my bad english xD


Re: [TuT]How TO MAke Moving Object - ToPhrESH - 13.07.2010

You need to tell them what they do and why


Re: [TuT]How TO MAke Moving Object - [NTX]MikeQ - 14.07.2010

Its simple, and in the beggining its little bit of fun it simply opens a 'gate' when /open.
And the timer closes the gate so you dont have to make a /close CMD.


Re: [TuT]How TO MAke Moving Object - Thebest96 - 15.07.2010

C:\Users\Antonio Carlos\Desktop\Nuno\gta sa\gamemodes\mynewscript.pwn(402) : error 017: undefined symbol "object"


Re: [TuT]How TO MAke Moving Object - Aleluja - 15.07.2010

Quote:
Originally Posted by Thebest96
Посмотреть сообщение
C:\Users\Antonio Carlos\Desktop\Nuno\gta sa\gamemodes\mynewscript.pwn(402) : error 017: undefined symbol "object"
did you put
pawn Код:
new object;
to me this is work great object .. !
Sorry For My BAD English!!


Re: [TuT]How TO MAke Moving Object - Thebest96 - 15.07.2010

E put new object and continue


Re: [TuT]How TO MAke Moving Object - Thebest96 - 15.07.2010

Now showme: C:\Users\Antonio Carlos\Desktop\Nuno\gta sa\gamemodes\mynewscript.pwn(570) : error 001: expected token: "#endif", but found "-end of file-"


Re: [TuT]How TO MAke Moving Object - Christian_Bojic - 15.07.2010

on end GM/FS type #endif


Re: [TuT]How TO MAke Moving Object - Thebest96 - 16.07.2010

Quote:
Originally Posted by Christian_Bojic
View Post
on end GM/FS type #endif
Thanks for the help.


Re: [TuT]How TO MAke Moving Object - Thebest96 - 16.07.2010

I put new object; in top of script and continue : C:\Users\Antonio Carlos\Desktop\Nuno\gta sa\gamemodes\yesy servere.pwn(236) : warning 203: symbol is never used: "object"


Re: [TuT]How TO MAke Moving Object - Lorenc_ - 16.07.2010

Quote:
Originally Posted by [NTX]MikeQ
Посмотреть сообщение
Its simple, and in the beggining its little bit of fun it simply opens a 'gate' when /open.
And the timer closes the gate so you dont have to make a /close CMD.
Maybe he should explain: Where to get those cords?


Re: [TuT]How TO MAke Moving Object - Retardedwolf - 16.07.2010

Quote:
Originally Posted by Thebest96
View Post
I put new object; in top of script and continue : C:\Users\Antonio Carlos\Desktop\Nuno\gta sa\gamemodes\yesy servere.pwn(236) : warning 203: symbol is never used: "object"
Put your own object not copy what he put on there.

He only gave an example.


Re: [TuT]How TO MAke Moving Object - Aleluja - 16.07.2010

pawn Code:
if (strcmp("/open", cmdtext, true, 10) == 0){      
MoveObject(object,1587.690,-1437.827,4.755, 2.00);      
SetTimer("close", 7000, 0);//gate will be  closed for 7 seconds      
SendClientMessage(playerid,GREEN,"You are opening a Gate, and will be closed automaticly..");      
return 1;}
}
did you put this
this COORDINATE to you dont work because this is EXAMPLE!!
Sorry bad englis :S


Re: [TuT]How TO MAke Moving Object - [NTX]MikeQ - 17.07.2010

TheBest96 show me your script parts were are objects included


Re: [TuT]How TO MAke Moving Object - Thebest96 - 19.07.2010

It FBI and LSPD, and now are good, sorry for ask here but you know how to script jobs and factions?


Re: [TuT]How TO MAke Moving Object - Aleluja - 23.07.2010

yes i now if you ask me xD


Re: [TuT]How TO MAke Moving Object - T4vY - 29.07.2010

In the first SS the gate is closed and the cords are : x:2158.72216796688 y:-63.829551696777 z:7.7667231559753
x:0.0 y:0.0 z:321.99829101563 (rotation)
/imageshack/img525/6...0729093740.png

I want the gate to be open in the right side...like in the 2nd SS

/imageshack/img18/227...0729093803.png
The cords are : x:2149.1650390625 y:-57.427307128906 z:7.7667231559753
x:0.0 y:0.0 z:321.99829101563 (rotation)

If you can make me a pawno code for this gates...i'll be very happy...+a cmd like /open and then after 7 seconds to be closed automatically..

Thank you very much,
T4viY


Re: [TuT]How TO MAke Moving Object - John_F - 29.07.2010

Quote:
Originally Posted by [NTX]MikeQ
Посмотреть сообщение
Its simple, and in the beggining its little bit of fun it simply opens a 'gate' when /open.
And the timer closes the gate so you dont have to make a /close CMD.
A better way to do it would be to put a place holder variable
and change the value of it when the gate opens/closes
Then test for the value of it to decide whether the gate opens closes, sry it's kind of hard to explain in words.

example:

Код:
new ifOpened;

ongamemodeinit
ifOpened = 0;

/gate
if(ifOpened = 0)
{
move the object to the opened position
ifOpened = 1;
}
else
{
move the object to the closed position
ifOpened = 0;
}
^^That way, if the gate is opened, the command closes it. If the gate is closed, the command opens it.


Re: [TuT]How TO MAke Moving Object - T4vY - 29.07.2010

Can anyone help me please with my problem? I tryed to do it like in the topic it says ...but I got a lot of errors...I want just an example with that coordinats and then I will do the rest. Thank you.


Re: [TuT]How TO MAke Moving Object - T4vY - 30.07.2010

Can anyone help me with that pawn codes and coordinats please?