SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 01/04/2012, 04:24 PM   #1
LukasSLT
Little Clucker
 
Join Date: Mar 2012
Posts: 4
Reputation: 0
Default AttachObjectToVehicle little help

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) :

Code:
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);
LukasSLT is offline   Reply With Quote
Old 01/04/2012, 07:12 PM   #2
LukasSLT
Little Clucker
 
Join Date: Mar 2012
Posts: 4
Reputation: 0
Default Re: AttachObjectToVehicle little help

Bump , please help.
LukasSLT is offline   Reply With Quote
Old 02/04/2012, 08:07 PM   #3
LukasSLT
Little Clucker
 
Join Date: Mar 2012
Posts: 4
Reputation: 0
Default Re: AttachObjectToVehicle little help

Bump
LukasSLT is offline   Reply With Quote
Old 05/04/2012, 12:54 PM   #4
LukasSLT
Little Clucker
 
Join Date: Mar 2012
Posts: 4
Reputation: 0
Default Re: AttachObjectToVehicle little help

Bump
LukasSLT is offline   Reply With Quote
Old 27/05/2012, 07:07 AM   #5
jaked1999
Little Clucker
 
Join Date: Mar 2012
Posts: 33
Reputation: 7
Default Re: AttachObjectToVehicle little help

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;
}
jaked1999 is offline   Reply With Quote
Old 27/05/2012, 07:25 AM   #6
Gangs_Rocks
Big Clucker
 
Join Date: Feb 2012
Location: Mars
Posts: 114
Reputation: 13
Default Re: AttachObjectToVehicle little help

^^ 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 */);
Gangs_Rocks is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Tutorial] AttachObjectToVehicle Wesley221 Tutorials 13 08/10/2015 04:40 PM
[Help]AttachObjectToVehicle nemanjatesic Scripting Help 0 11/02/2012 09:03 AM
AttachObjectToVehicle YungGee Help Archive 0 27/02/2011 09:40 AM
AttachObjectToVehicle luis_lpv_22 Help Archive 2 08/02/2011 02:51 PM


All times are GMT. The time now is 12:16 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.