Moving Object with rotation
#1

I have a little problem with my automatic gates i mean, when i create a gate what lifting up and down it is works fine! But when i want to create a gate which i change only the rotation Values to move the gate moving is to fast, it is recently do it and not smoothly. Anybody can help me?

Sorry for my English.
Reply
#2

Could you explain it a bit more? :S
Reply
#3

pawno (filterscript)
Код:
#include <a_samp>
forward CheckGate();
new Gate1;


public OnFilterScriptInit()
{
	SetTimer("CheckGate", 1000, true);
	CreateObject(966, 1328.74, -1385.46, 12.69,   0.00, 0.00, 0.00); // Gate1 talp
	Gate1 = CreateObject(968, 1328.74, -1385.45, 13.47, 1.92, -90.30, 0.00);
	print("\n--------------------------------------");
	print(" Gates! ");
	print("--------------------------------------\n");
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

public CheckGate()
{
	for(new i=0; i<MAX_PLAYERS; i++)
	{
	    if(IsPlayerConnected(i))
	    {
	        if(IsPlayerInRangeOfPoint(i, 5.00, 1325.0199,-1387.8572,13.6263))
	        {
				MoveObject(Gate1, 1328.74, -1385.45, 15.98, 3);
			}
			else
			{
			    MoveObject(Gate1, 1328.74, -1385.45, 13.47, 3);
			}
		}
	}
}
Its WOrking well! But if i Change only the Rotation values the gate will be move suddenly at the position not smoothly :S

for example
Код:
#include <a_samp>
forward CheckGate();
new Gate1;


public OnFilterScriptInit()
{
	SetTimer("CheckGate", 1000, true);
	CreateObject(966, 1328.74, -1385.46, 12.69,   0.00, 0.00, 0.00); // Gate1 talp
	Gate1 = CreateObject(968, 1328.74, -1385.45, 13.47, 1.92, -90.30, 0.00);
	print("\n--------------------------------------");
	print(" Gates! ");
	print("--------------------------------------\n");
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

public CheckGate()
{
	for(new i=0; i<MAX_PLAYERS; i++)
	{
	    if(IsPlayerConnected(i))
	    {
	        if(IsPlayerInRangeOfPoint(i, 5.00, 1325.0199,-1387.8572,13.6263))
	        {
				MoveObject(Gate1, 1328.74, -1385.45, 13.47, 3,0.00,-90.0,-4.0); // i edited only the [Y] and [Z] rotation value
			}
			else
			{
			    MoveObject(Gate1, 1328.74, -1385.45, 13.47, 3,0.00,0.00,0.00);
			}
		}
	}
}
Reply
#4

Well create a new object (also new position with the rotation value!). change rotation makes your perfect gate opening bad.
Reply
#5

I want to change only the rotation value . I don't understand what u are saying, can u paste the full code?
Reply
#6

Rotation will be bugged unless you are using the latest version of the Streamer Plugin

Download the latest verstion
Reply
#7

Useless answer again, because he's not using a streamer. OT: I had the same problem with one of my barriers. I solved it by altering the x, y, z coordinates in the MoveObject statement with just a tiny bit (0.1 or something). For some reason it does indeed not work if only the rotation is changed.
Reply
#8

See my tutorial on this: https://sampforum.blast.hk/showthread.php?tid=295590
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)