Destroy Vehicle when not in vehicle?
#1

Hey,

i have a question: is there a way to destroy a vehicle when someone leaves a car for more than 30 seconds?
The cars are spawned with CreateVehicle().

So, can someone explain this to me?
Reply
#2

https://sampwiki.blast.hk/wiki/CreateVehicle

respawn_delay = 30

If you mean to destroy and not respawn, you could have the vehicle destroyed as it respawns.
Reply
#3

Quote:
Originally Posted by Austin
Посмотреть сообщение
https://sampwiki.blast.hk/wiki/CreateVehicle

respawn_delay = 30

If you mean to destroy and not respawn, you could have the vehicle destroyed as it respawns.
Yes, I mean destroy. So my new question: how to destroy it on respawn? (I have not found a OnVehicleRespawn callback)
Reply
#4

Leave out the 'Re'

https://sampwiki.blast.hk/wiki/OnVehicleSpawn
Reply
#5

Yes use search first
Reply
#6

Ow thanks, I'm sorry, but this callback was not included in my GM.

And I did use search but I didn't find anything.
Reply
#7

Quote:
Originally Posted by SalN
Посмотреть сообщение
Ow thanks, I'm sorry, but this callback was not included in my GM.

And I did use search but I didn't find anything.
Then you are a fail.

http://forum.sa-mp.com/search.php?searchid=720898
Reply
#8

You bunch of failers XD .


The thing is, destroying it on Spawn will be make it impossible to even get it in the first time.

It's possible and quite easy.

When OnPlayerStateChange -> if( oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER )

Just Set an EX Timer for the vehicle.

In the timer, check with a loop if IsPlayerInVehicle(i, vehicleid) and if not, then Destroy it.
Reply
#9

<removed>
________
BIG TITS VID
Reply
#10

Quote:
Originally Posted by cmg4life
Посмотреть сообщение
You bunch of failers XD .


The thing is, destroying it on Spawn will be make it impossible to even get it in the first time.

It's possible and quite easy.

When OnPlayerStateChange -> if( oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER )

Just Set an EX Timer for the vehicle.

In the timer, check with a loop if IsPlayerInVehicle(i, vehicleid) and if not, then Destroy it.
I did this before I saw your post, because I realized this also
And I had searched with ****** and not with the forums search because I hate typing in the captcha over and over again.

So thanks to everybody who has helped me (and called me a fail), because I found the solution and it's the same as cmg4life's solution.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)