SA-MP Forums Archive
attached object - 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: attached object (/showthread.php?tid=210276)



attached object - WestTillIdie - 12.01.2011

is there a way to get positions xyz of attached object to player or vehicle? getobjectpos dont get..


Re: attached object - Marcel - 12.01.2011

Are you sure they don't work? Are you using the function in the correct way?


Re: attached object - WestTillIdie - 12.01.2011

yes i think can you show example that works


Re: attached object - WestTillIdie - 12.01.2011

sorry for doublepost here is test
Quote:

#include <a_samp>

new obj;
new car;

public OnGameModeInit()
{
car = CreateVehicle(405, 2109.1763, 1503.0453, 32.2887, 82.2873, 0, 1, 60);
obj = CreateObject(2587, 0.0, 0.0, 0.0, 0.0, 0.0, 96.0);
SetTimer("update",1000,true);
return 1;
}

forward update();
public update()
{
new Float:x;
new Float:y;
new Float:z;
AttachObjectToVehicle(obj, car, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0);
GetObjectPos(obj, x, y, z);
printf("x:%f y:%f z%f",x,y,z);
return 1;
}

i get this

Quote:

[01:25:25] x:0.000000 y:0.000000 z0.000000
[01:25:26] x:0.000000 y:0.000000 z0.000000
[01:25:27] x:0.000000 y:0.000000 z0.000000
[01:25:28] x:0.000000 y:0.000000 z0.000000
[01:25:29] x:0.000000 y:0.000000 z0.000000




Re: attached object - WestTillIdie - 12.01.2011

bump


Re: attached object - WestTillIdie - 12.01.2011

bump