Doesn't attach object to vehicle
#1

I was trying to attach submarine to small boat and it doesn't work.

OnGameModeInit
Код:
	sub[0] = AddStaticVehicle(473, 391.2693, 337.8383, -0.0889, 37.0974, 1, 5); // Podmornica 1
	sub[1] = AddStaticVehicle(473, 375.7180, 324.6970, -0.1708, 31.9929, 1, 5); // Podmornica 2

	submarine[0] = CreateDynamicObject( 1612, 0, 0, 0, 0, 0, 0, 80 );
	submarine[1] = CreateDynamicObject( 1612, 0, 0, 0, 0, 0, 0, 80 );

	AttachObjectToVehicle( submarine[0], sub[0], 0.299999, -22.800050, 3.699998, 0.000000, 0.000000, 0.000000 );
	AttachObjectToVehicle( submarine[1], sub[1], 0.299999, -22.800050, 3.699998, 0.000000, 0.000000, 0.000000 );
Reply
#2

Can we not make it array but simple sub1 and sub2 ?
Reply
#3

Wrong function you need this one.

pawn Код:
native AttachDynamicObjectToVehicle(objectid, vehicleid, Float:offsetx, Float:offsety, Float:offsetz, Float:rx, Float:ry, Float:rz);
Reply
#4

I've tried with AttachDynamicObjectToVehicle, and now it look's like this

Код:
	sub[0] = AddStaticVehicle(473, 391.2693, 337.8383, -0.0889, 37.0974, 1, 5); // Podmornica 1
	sub[1] = AddStaticVehicle(473, 375.7180, 324.6970, -0.1708, 31.9929, 1, 5); // Podmornica 2

	submarine = CreateDynamicObject( 1612, 0, 0, 0, 0, 0, 0, 80 );
	submarine1 = CreateDynamicObject( 1612, 0, 0, 0, 0, 0, 0, 80 );

	AttachDynamicObjectToVehicle( submarine, sub[0], 0.299999, -22.800050, 3.699998, 0.000000, 0.000000, 0.000000 );
	AttachDynamicObjectToVehicle( submarine1, sub[1], 0.299999, -22.800050, 3.699998, 0.000000, 0.000000, 0.000000 );
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)