Parked Cars
#1

Hi,

I was wondering if its possible to make it so cars that spawn by defualt don't move if they are crashed into, but also have it so if someone where to get into a spawned car, and drive it away and then dump it, that this rule would not apply to said car? (basicly having it so only the cars that are still in the original coords are frozen, and not cars that are driven away.)

Thanks!
Reply
#2

Hm, not possible in the way you want it to work, but you can set a timer, that checks (for all vehicle ids) if a vehicle is on or near its spawn position (you will have to store them) and if yes, sets it back to it. You will also have to set the pos when the car is at exactly the same position, because the position does not update, when nobody drives it, so it will also return the spawn pos, when someone crashed into it.
Reply
#3

Quote:
Originally Posted by Mauzen
Посмотреть сообщение
Hm, not possible in the way you want it to work, but you can set a timer, that checks (for all vehicle ids) if a vehicle is on or near its spawn position (you will have to store them) and if yes, sets it back to it. You will also have to set the pos when the car is at exactly the same position, because the position does not update, when nobody drives it, so it will also return the spawn pos, when someone crashed into it.
Thanks. How close to the spawn are we talking? The only reason I ask is, I'll be having loads of cars parked on the roads, and I am pretty certain that idiots will want to crash around into them. When I did that to check, the roads got really messy, so I want the ones that get crashed into to be able to spawn back within a few seconds.

Is it possible to set spawn distances?
Reply
#4

Bump
Reply
#5

As mentioned above it's a case of getting the cars position within a timer. Reset the position of the car if no one is driving it and it has moved out of the vehicles spawn position.

pawn Код:
GetVehiclePos
GetVehicleZAngle
SetVehiclePos
SetVehicleZAngle
Use the above within the timer and it should be fairly simple. You will proberly want a timer that is repeating every 30 secconds or so.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)