any ideas?
#1

any ideas on how to automatically re-attach the trailer to a vehicle after it de-attached?
Reply
#2

Create an integer variable for each vehicle (in this case an array) - let's called it trailerId, and set it to the trailer's ID (vehicle id because trailers are vehicles) whenever someone attaches a trailer to their vehicles, then to INVALID_VEHICLE_ID when they detach it.
Create a reoccurring timer, that loops through vehicles and checks if their trailerId equals INVALID_VEHICLE_ID, if not, attach the trailer with that id if it's not attached already.
Reply
#3

wouldnt a reoccurring timer that checks trough all vehicles of all players cause some lag?

should i just create a timer that only checks the vehicle to whom you can attach a trailer?would that be more optimized?
Reply
#4

you can use timer for it like when player enter vehicle settimer in timer it will check is trailer is attached or not https://sampwiki.blast.hk/wiki/IsTrailerAttachedToVehicle and if not attached use this https://sampwiki.blast.hk/wiki/AttachTrailerToVehicle
hope u will understand.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)