attatch object to vehicle
#1

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!
Reply
#2

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
Reply
#3

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
Reply
#4

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 | 
Reply
#5

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".
Reply
#6

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); 
Reply
#7

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.
Reply
#8

thanks guy gave all 3 of u rep!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)