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.