Attaching object to vehicle
#2

Quote:
Originally Posted by Knekt
Посмотреть сообщение
I'm trying to attach a pizzabox object to the vehicle everytime you enter the vehicle and then destroying it once you've exitted it(it's hard to enter the vehicle once there's an object in the way).

The object is not being placed when they enter the vehicle, why?


When they enter the vehicle: (onplayerstatechange)
pawn Код:
new vehicleid =  GetPlayerVehicleID(playerid);
AttachObjectToVehicle(objectid2, vehicleid, 0, -1, 0.5, -1.6, 0.0, 0.0);
When they exit the vehicle: (onplayerexitvehicle)
pawn Код:
DestroyObject(objectid2);
You would need to check if they entered the vehicle (OnPlayerStateChange), then get their vehicleid, and if it's the id of the car you want, attach object to vehicle, but im pretty sure you'd need to createobject first.
Reply


Messages In This Thread
Attaching object to vehicle - by Knekt - 28.02.2014, 06:30
Re: Attaching object to vehicle - by Aerotactics - 28.02.2014, 06:33
Re: Attaching object to vehicle - by Threshold - 28.02.2014, 06:34
Re: Attaching object to vehicle - by Knekt - 28.02.2014, 06:35
Re: Attaching object to vehicle - by Aerotactics - 28.02.2014, 06:38
Re: Attaching object to vehicle - by Knekt - 28.02.2014, 06:41
Re: Attaching object to vehicle - by Threshold - 01.03.2014, 15:00

Forum Jump:


Users browsing this thread: 2 Guest(s)