How to create a move object.
#1

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

Change 1000 to like 2 (or 1)
Reply
#3

Ok i'll.
Reply
#4

And by the way how to make code to pwncode
Reply
#5

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

[.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)
Reply
#7

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

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

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

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

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'.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)