[Tutorial] [TuT]How TO MAke Moving Object
#1

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
Reply
#2

You need to tell them what they do and why
Reply
#3

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.
Reply
#4

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

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!!
Reply
#6

E put new object and continue
Reply
#7

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

on end GM/FS type #endif
Reply
#9

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

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"
Reply
#11

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?
Reply
#12

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.
Reply
#13

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
Reply
#14

TheBest96 show me your script parts were are objects included
Reply
#15

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

yes i now if you ask me xD
Reply
#17

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
Reply
#18

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.
Reply
#19

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.
Reply
#20

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


Forum Jump:


Users browsing this thread: 1 Guest(s)