SA-MP Forums Archive
How to create a move 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)
+--- Thread: How to create a move object. (/showthread.php?tid=344738)



How to create a move object. - Gangster-rocks - 22.05.2012

you can see this
Код:
	if (strcmp("/open", cmdtext, true, 10) == 0)
	{   MoveObject(2990,2483.01660156,-1687.36755371,16.42179298,1000);
		SetTimer("close", 10000, 0);//the gate will close after 10 seconds
       
	   return 1;
	}
and its wont open in the game please help me.


Re: How to create a move object. - [ABK]Antonio - 22.05.2012

Change 1000 to like 2 (or 1)


Re: How to create a move object. - Gangster-rocks - 22.05.2012

Ok i'll.


Re: How to create a move object. - Gangster-rocks - 22.05.2012

And by the way how to make code to pwncode


Re: How to create a move object. - vIBIENNYx - 22.05.2012

pawn Код:
if (strcmp("/open", cmdtext, true, 10) == 0)
    {  
        MoveObject(2990,2483.01660156,-1687.36755371,16.42179298,1000);
        SetTimer("close", 10, 0);//the gate will close after 10 seconds
       
       return 1;
    }
Try that.


Re: How to create a move object. - [ABK]Antonio - 22.05.2012

[.pawn] [/pawn] (without the .)



Quote:
Originally Posted by vIBIENNYx
Посмотреть сообщение
pawn Код:
if (strcmp("/open", cmdtext, true, 10) == 0)
    {  
                          MoveObject(2990,2483.01660156,-1687.36755371,16.42179298,1000);
        SetTimer("close", 10, 0);//the gate will close after 10 seconds
       
       return 1;
    }
Try that.
10,000 milliseconds = 10 seconds
10 milliseconds = 10 milliseconds. (instantly calls close function once the gate opens)


Re: How to create a move object. - vIBIENNYx - 22.05.2012

Then, he should do this..

Remove the SetTimer, seeing as the new MoveObject allows a time function.

pawn Код:
MoveObject(2990, 2483.01660156, -1687.36755371, 16.42179298, 10, 0.0, 0.0, 0.0)
Replace both those lines with that, it should work.


Re: How to create a move object. - [ABK]Antonio - 22.05.2012

Quote:
Originally Posted by vIBIENNYx
Посмотреть сообщение
Then, he should do this..

Remove the SetTimer, seeing as the new MoveObject allows a time function.

pawn Код:
MoveObject(2990, 2483.01660156, -1687.36755371, 16.42179298, 10, 0.0, 0.0, 0.0)
Replace both those lines with that, it should work.
The time param is the time it takes for it to reach the destination, not when it closes..


Re: How to create a move object. - vIBIENNYx - 22.05.2012

Oh, my bad.. I see the issue now..

Out of curiosity, have you declared "close" as a function?


Re: How to create a move object. - SuperViper - 22.05.2012

You're trying to move object ID 2990, which is 1) above the object limit, 2) an object model ID. You need to create a variable and your CreateObject line should look something like this:

pawn Код:
variable = CreateObject( ..params.. );
Then replace 2990 in your MoveObject line with 'variable'.