Destroy Vehicle when not in vehicle? -
SalN - 16.10.2010
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?
Re: Destroy Vehicle when not in vehicle? -
Austin - 16.10.2010
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.
Re: Destroy Vehicle when not in vehicle? -
SalN - 16.10.2010
Quote:
Originally Posted by Austin
|
Yes, I mean destroy. So my new question: how to destroy it on respawn? (I have not found a OnVehicleRespawn callback)
Re: Destroy Vehicle when not in vehicle? -
Mauzen - 16.10.2010
Leave out the 'Re'
https://sampwiki.blast.hk/wiki/OnVehicleSpawn
Re: Destroy Vehicle when not in vehicle? -
Thebest96 - 16.10.2010
Yes use search first
Re: Destroy Vehicle when not in vehicle? -
SalN - 16.10.2010
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.
Respuesta: Re: Destroy Vehicle when not in vehicle? -
The_Moddler - 16.10.2010
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
Re: Destroy Vehicle when not in vehicle? -
cmg4life - 16.10.2010
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.
Destroy Vehicle when not in vehicle? -
[NoV]LaZ - 16.10.2010
<removed>
________
BIG TITS VID
Re: Destroy Vehicle when not in vehicle? -
SalN - 16.10.2010
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.