DetachTrailerFromVehicle
#1

Hey

How I could detach a trailer from Baggage? I tried to attach the trailer to the vehicle before detaching but it's still connected to the vehicle... I think this is a bug, becouse I hear the sound of the detaching, but the trailer is too close to the beggae and it's get connected again. How I can fix this without changing the trailer position?
Reply
#2

can you show me your attach and detach code?
Reply
#3

Quote:
Originally Posted by Kraeror
Посмотреть сообщение
can you show me your attach and detach code?
Код:
	new trailerid = GetVehicleTrailer(vehicleid);
	AttachTrailerToVehicle(trailerid, vehicleid);
	DetachTrailerFromVehicle(vehicleid);
It's working with the trucks and the trailers but don't work with the baggage and the 606, 607 (maybe 608 too) trailers
Reply
#4

What vehicle you want to connect to the 606,607 trailers?
Reply
#5

Quote:
Originally Posted by Kraeror
Посмотреть сообщение
What vehicle you want to connect to the 606,607 trailers?
Reply
#6

show me the code where you are creating the vehicle and the trailer!
Reply
#7

Quote:
Originally Posted by Kraeror
Посмотреть сообщение
show me the code where you are creating the vehicle and the trailer!
Why? I have to create the trailers as static vehicles? Why does it matter?
Reply
#8

Quote:
Originally Posted by m4karow
Посмотреть сообщение
Why? I have to create the trailers as static vehicles? Why does it matter?
because I can see the variable "trailerid" equals to GetVehicleTrailer and that means you have already attached a trailer to the vehicle, because this functions "gets the ID of the trailer attached to a vehicle".
I think trailerid has to equal to CreateVehicle(606...);, I'm not sure because I don't have the other code (where are created vehicles, trailers and etc.)
Reply
#9

No, the values are correct.

Код:
	new trailerid = GetVehicleTrailer(vehicleid);
	DetachTrailerFromVehicle(vehicleid);

	new Float:X, Float:Y, Float:Z;
	GetVehiclePos(trailerid, X, Y, Z);
	SetVehiclePos(trailerid, X + 1, Y, Z);
As I said the problem is the trailer is too close to the vehicle and whenever I detached it, it's got connected again. This solve this problem.

Anyway, thanks for your reply.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)