AttachObjectToVehicle little help
#1

Hi, I want to attach some objects to vehicle , but I don't know where to put it , so anyone please help me.
Here I put code of my objects and vehicle (everythink is straight from pawno , I didn't converted it) :

Код:
CreateObject(8499, 0.00, 26.12, 17.00,   0.00, 0.00, 0.00);
CreateObject(983, 4.34, 13.82, 4.71,   0.00, 0.00, 1.00);
CreateObject(983, 4.71, 4.76, 5.73,   0.00, 0.00, 3.00);
CreateObject(983, -5.73, 4.81, 5.73,   0.00, 0.00, -3.00);
CreateObject(983, -5.34, 13.75, 4.71,   0.00, 0.00, -2.00);
CreateObject(983, -5.18, 21.31, 4.71,   0.00, 0.00, 0.00);
CreateObject(983, 4.17, 21.31, 4.71,   0.00, 0.00, 0.00);
CreateObject(983, 4.21, 26.45, 5.63,   0.00, 0.00, 2.00);
CreateObject(983, -5.31, 26.45, 5.63,   0.00, 0.00, -2.00);
CreateObject(983, -4.19, 34.73, 6.49,   0.00, 0.00, -13.00);

and

CreateVehicle(404, 0.0000, 0.0000, 0.0000, 0.0000, -1, -1, 100);
Reply
#2

Bump , please help.
Reply
#3

Bump
Reply
#4

Bump
Reply
#5

i would do this with a cmd but this should show how it works also wiki AttachObjectToVehicle
CMD:yourcmd(playerid,params[])
{
new object = CreateObject(8499,0.0,0.0,0.0,0.0,0.0,0.0,100.0);
new object1 = CreateObject(983,0.0,0.0,0.0,0.0,0.0,0.0,100.0);
new object2 = CreateObject(983,0.0,0.0,0.0,0.0,0.0,0.0,100.0);
new vehicleid = GetPlayerVehicleID(playerid);
AttachObjectToVehicle(object, vehicleid, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0);//play around with this coords a bit
AttachObjectToVehicle(object1, vehicleid, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0);//play around with this coords a bit
AttachObjectToVehicle(object2, vehicleid, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0);//play around with this coords a bit
return 1;
}
CMD:removefromcar(playerid,params[])
{
DestroyObject(object[playerid]);
DestroyObject(object1[playerid]);
DestroyObject(object2[playerid]);
return 1;
}
Reply
#6

^^ Fail command Jaked.

I'd put it under OnVehicleSpawn and create a command to respawn all vehicles.
OR You can just create a simple:


CMD:armcars(playerid,params[])
{
AttachObjectToVehicle(NEWOBJECT1, THENEWVEHICLEID, /* bla bla bla coords */);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)