SA-MP Forums Archive
Moving objects :/ - 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: Moving objects :/ (/showthread.php?tid=451542)



Moving objects :/ - Lajko1 - 17.07.2013

Hello I am making some tests with moving objects and I don't figure out what should be wrong
So I am trying to do objects that will be targets for shooters, I created objects and I made /test command to test if objects will move correctly but they don't, they just appear there... I want to make that objects will be slowly getting up from ground( like the targets at places that are people training shooting), I put the moving speed from 5.0, to 3.0 and 1.0 and 0.1 and everything is same :/ there is no effect

Here is the code
pawn Код:
new SHOTOBJ1;
new SHOTOBJ2;
pawn Код:
SHOTOBJ1 = CreateObject(1584,1456.1999511719,-1805.8000488281,4084.6000976563,87.172088623047,225.01835632324,47.016540527344); // TARGET 1
    SHOTOBJ2 = CreateObject(1584,1457.0000000,-1803.6999511719,4084.6000976563,90.0000000,182.33979797363,85.654205322266); // TARGET 2
and command to move them
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/test", cmdtext, true, 5) == 0)
    {
        MoveObject(SHOTOBJ1,1456.1999511719,-1805.8000488281,4084.6000976563,0.1,358.25085449219,357.99917602539,271.93902587891);
        MoveObject(SHOTOBJ2,1457.0000000,-1803.6999511719,4084.6000976563,0.1,2.0000305175781,0.0000000,267.99401855469);
        SendClientMessage(playerid,0xAA3333AA,"test msg");
       
        return 1;
    }
    return 0;
}
Thanks in advance!


Re: Moving objects :/ - Vince - 17.07.2013

For MoveObject to work, there must be movement. Just changing the angles won't work. You need a deflection in position, even if that deflection is just 0.01 units.


Re: Moving objects :/ - Lajko1 - 17.07.2013

And how to do this ? :/


Re: Moving objects :/ - Skillzz - 17.07.2013

Quote:
Originally Posted by Lajko1
Посмотреть сообщение
And how to do this ? :/
You will need to get the X, Y and Z cords. I can help if needed. PM me or reply here. I will watch this thread for a day or two.


Re: Moving objects :/ - Lajko1 - 18.07.2013

As you see I already got coords but I want to move object to right position with rotation coords (rx ry rz)


Re: Moving objects :/ - faff - 18.07.2013

Use SetObjectRot;?


Re: Moving objects :/ - Lajko1 - 18.07.2013

I will try.


Re: Moving objects :/ - Lajko1 - 19.07.2013

Quote:
Originally Posted by faff
Посмотреть сообщение
Use SetObjectRot;?
I tried that but it's same, objects just appear at that location, but a thing what I want to make is that object will slowly "raise" from the ground with rotation coords... because I'm trying to make "shooting training" so when I will type /test the targets will slowly raise from the ground... now with adding coord Z, but I want to make this with rotation coords and speed is that possible ? :/