SA-MP Forums Archive
attatch object to vehicle - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Server (https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: attatch object to vehicle (/showthread.php?tid=598394)



attatch object to vehicle - Nightmares - 11.01.2016

AttachObjectToVehicle(objectid, vehicleid, 0.034999, -0.379994, 0.519999, 0.000000, 0.000000, 0.000000); //Object Model: 19419 |


I am posting this in the gamemode, no errors and when I go on the car isn't changed. its a bullet. What am I doing wrong? =1 rep whoever help!


Re: attatch object to vehicle help =1REP - lucamsx - 12.01.2016

GetPlayerVehicleID maybe? You need to specify the vehicle.
Also, wrong section. This is the right place: http://forum.sa-mp.com/forumdisplay.php?f=12


Re: attatch object to vehicle help =1REP - Nightmares - 12.01.2016

Quote:
Originally Posted by lucamsx
Посмотреть сообщение
GetPlayerVehicleID maybe? You need to specify the vehicle.
Also, wrong section. This is the right place: http://forum.sa-mp.com/forumdisplay.php?f=12
can u do for me


Re: attatch object to vehicle help =1REP - SaltySandy - 12.01.2016

You'll have to define what vehicle IDs get what object and on what location:
( Wiki post: https://sampwiki.blast.hk/wiki/GetPlayerVehicleID )
Код:
(objectid, vehicleid, Float:OffsetX, Float:OffsetY, Float:OffsetZ, Float:RotX, Float:RotY, Float:RotZ)
For your code, noting that the bullet has to be vehicle ID 1:
PHP код:
AttachObjectToVehicle(objectidvehicleid0.034999, -0.3799940.5199990.0000000.0000000.000000); //Object Model: 19419 | 
objectid should be 19419 ( I believe, as I can see from your post )
vehicleid should be 1 ( or whatever the ID of the vehicle is )

PHP код:
AttachObjectToVehicle(1941910.034999, -0.3799940.5199990.0000000.0000000.000000); //Object Model: 19419 | 



Re: attatch object to vehicle help =1REP - lucamsx - 12.01.2016

Quote:
Originally Posted by SaltySandy
Посмотреть сообщение
PHP код:
AttachObjectToVehicle(1941910.034999, -0.3799940.5199990.0000000.0000000.000000); //Object Model: 19419 | 
what?
Код:
new vehid;
vehid = GetPlayerVehicleID(playerid);
replace "1" with "vehid".


Re: attatch object to vehicle help =1REP - AbyssMorgan - 12.01.2016

objectid this is not a modelid !!
PHP код:
new tmpobj CreateObject(modelidFloat:XFloat:YFloat:ZFloat:rXFloat:rYFloat:rZFloat:DrawDistance 0.0);
AttachObjectToVehicle(tmpobjvehicleidFloat:OffsetXFloat:OffsetYFloat:OffsetZFloat:RotXFloat:RotYFloat:RotZ);
OR
new 
tmpobj CreateDynamicObject(modelidFloat:xFloat:yFloat:zFloat:rxFloat:ryFloat:rzworldid = -1interiorid = -1playerid = -1Float:streamdistance STREAMER_OBJECT_SDFloat:drawdistance STREAMER_OBJECT_DD);
AttachDynamicObjectToVehicle(tmpobjvehicleidFloat:offsetxFloat:offsetyFloat:offsetzFloat:rxFloat:ryFloat:rz); 



Re: attatch object to vehicle help =1REP - SaltySandy - 12.01.2016

Quote:
Originally Posted by lucamsx
Посмотреть сообщение
what?
Код:
new vehid;
vehid = GetPlayerVehicleID(playerid);
replace "1" with "vehid".
I copied his code and went on to explain in the rest of my post.


Re: attatch object to vehicle help =1REP - Nightmares - 13.01.2016

thanks guy gave all 3 of u rep!