attach object to vehicle - 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)
+--- Thread: attach object to vehicle (
/showthread.php?tid=419995)
attach object to vehicle -
audriuxxx - 03.03.2013
new THECAR[ 1 ];
Код:
THECAR[ 0 ] = AddStaticVehicleEx(560,-2185.8000488,715.5000000,53.7000008,180.0000000,45,58,15); //Voodoo
new object = CreateDynamicObject( 18646,0,0,0,0,0,0,80 ); // <iVO>
AttachDynamicObjectToVehicle( object, THECAR[ 0 ], -0.859999, 0.049999, 1.140000, 0.000000, 0.000000, 0.000000 ); // <iVO>
But when i go to game, and near this car i don't see any object. I use IVO object to vehicle editor, there all was fine, but when i add this to my gamemode, i don't see anything..
Re: attach object to vehicle -
RenSoprano - 03.03.2013
Add this to the top of your script
then
pawn Код:
public OnGameModeInit()
{
TheCar = AddStaticVehicle(560,-2185.8000488,715.5000000,53.7000008,180.0000000,45,58,15);
return 1;
}
After you are ready to attach your objecto to your car
pawn Код:
public OnPlayerConnect(playerid)
{
new object = CreateObject(18646,0,0,0,0,0,0);
AttachObjectToVehicle(object, TheCar, -0.859999, 0.049999, 1.140000, 0.000000, 0.000000, 0.000000);
return 1;
}
Re: attach object to vehicle -
audriuxxx - 03.03.2013
Need to create car first, and later attach object? why i can't to do that instantly?
Re: attach object to vehicle -
audriuxxx - 03.03.2013
up thread.
Re: attach object to vehicle -
audriuxxx - 03.03.2013
Up thread.
Re: attach object to vehicle -
audriuxxx - 03.03.2013
Up thread.