GetCheckpointRot?
#1

Hi all

I have a problem, how can I get the rotation of checkpoint?
I saw something like that in this topic
https://sampforum.blast.hk/showthread.php?tid=116622

how he said
Quote:

@Trooper[Y] I use SetObjectRot.With Attach,object too laggy.Iґm tested with many solutions and with SetObjectRot is the best.

I have this
pawn Код:
SetPlayerCheckpoint(playerid, 1215.3896,-1844.5940,13.3828, 4.0);
            CurrentPlayerCP[playerid] = 1;
            DS_Arrow[playerid] = CreateObject(1318,20.20000076,-502.79998779,8.50000000,0.00000000,90.00000000,0.00000000);
            AttachObjectToPlayer(DS_Arrow[playerid], playerid, 0, 0, 1, 0, 90, 2);
            SetObjectRot(DS_Arrow[playerid], 1215.3896, -1844.5940, 13.3828);
So I want to calculate how to get rotation of this cp so I can set that rot on my object?
Reply
#2

A checkpoint is circle, there is no need for rotation as all the sides will be the same no matter how you rotate it.
Reply
#3

Yeah but it still doesn't work, take a look on code, please
Reply
#4

https://sampwiki.blast.hk/wiki/AttachObjectToPlayer

Look at the parameters, the rotation is there.
Reply
#5

Yeah I know but look now,
http://zaslike.com/files/tdz1g1effudywve2189j.png
I want it to be rotated to look on that cp, what should I do?
pawn Код:
DS_Arrow[playerid] = CreateObject(1318,20.20000076,-502.79998779,8.50000000,0.00000000,90.00000000,0.00000000);
            SetObjectRot(DS_Arrow[playerid], 1215.3896, -1844.5940, 13.3828);
            ObjectRot[playerid][0] = 1215.3896;
            ObjectRot[playerid][1] = -1844.5940;
            ObjectRot[playerid][2] = 13.3828;
            AttachObjectToPlayer(DS_Arrow[playerid], playerid, 0, 0, 1, ObjectRot[playerid][0], ObjectRot[playerid][1], ObjectRot[playerid][2]);
Reply
#6

Are you sure SetObjectRot isn't meant to be MoveObject because I have never seen someone use -1844.5940 degrees.
Reply
#7

I tried:
pawn Код:
SetPlayerCheckpoint(playerid, 1215.3896,-1844.5940,13.3828, 4.0);
            CurrentPlayerCP[playerid] = 1;
            DS_Arrow[playerid] = CreateObject(1318,20.20000076,-502.79998779,8.50000000,0.00000000,90.00000000,0.00000000);
            AttachObjectToPlayer(DS_Arrow[playerid], playerid, 0, 0, 1, 0, 90, 2);
            GetObjectPos(DS_Arrow[playerid], ObjectPos[playerid][0], ObjectPos[playerid][1], ObjectPos[playerid][2]);
            MoveObject(DS_Arrow[playerid], ObjectPos[playerid][0], ObjectPos[playerid][1], ObjectPos[playerid][2], 3.0, 1215.3896, -1844.5940, 13.3828);
but it doesn't work, I realy don't know what should I do!
Reply
#8

You need to use maths including player position, player facing angle and. Checkpoint position.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)