[Help] How to get offset for AttachObjectToPlayer - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [Help] How to get offset for AttachObjectToPlayer (
/showthread.php?tid=67530)
[Help] How to get offset for AttachObjectToPlayer -
Yoyoyo - 02.03.2009
I have a submarine object. I made a code to drive the submarine by using a boat, and the object. Its like this.
Код:
Sub4 = CreateObject(9958, -1268.290894, 424.869446, 6.485734, 0.0000, 0.0000, 86.5623);
------------------------
if(strcmp(cmdtext, "/sail1", true) == 0)
{
if(Sailing[playerid] == true) return SendClientMessage(playerid, COLOR_BRIGHTRED, "You are already in the sub!");
if(ShipTaken == 1) return SendClientMessage(playerid, COLOR_BRIGHTRED, "Someone else is already in the sub!");
Sailing[playerid] = true;
ShipTaken = 1;
SailBoat[playerid] = CreateVehicle(430, -1324.9653,427.6149,-0.3219, 271.2040, 0, 0, 15000);
LinkVehicleToInterior(SailBoat[playerid], 10);
PutPlayerInVehicle(playerid, SailBoat[playerid], 0);
AttachObjectToPlayer(Sub4, playerid, 10.0, 15.0, -0.87, 5.0, 5.0, 10.0);
return 1;
}
Код:
It works but the offset is messed up. The sub isnt straight with the boat.
My question: How do you find the offset of the object?
Re: [Help] How to get offset for AttachObjectToPlayer -
Yoyoyo - 02.03.2009
Help please!
Re: [Help] How to get offset for AttachObjectToPlayer -
Nubotron - 02.03.2009
You have to do it manually, i suggest you to make /offsetx, /offsety and /offsetz (or /offset x y z) commands, if you know what i mean.
Re: [Help] How to get offset for AttachObjectToPlayer -
Yoyoyo - 02.03.2009
Where can i get those commands, cause i dont know how to make them xD