How to automatically delete car after player exits? I have this so far.. -
ThePS3Guy - 08.08.2009
under onfilterscriptinit()
SetTimer("DelCar", 2000, 1);
at the top
forward DelCar();
I don't know much about what else to do...
I think maybe it has to do with
public onplayerexitvehicle (playerid, vehicleid)
Re: How to automatically delete car after player exits? I have this so far.. -
Weirdosport - 08.08.2009
You want to delete the vehicle the player was in when they get out of it?
In that case you'd use:
https://sampwiki.blast.hk/wiki/DestroyVehicle
and
https://sampwiki.blast.hk/wiki/OnPlayerExitVehicle
Re: How to automatically delete car after player exits? I have this so far.. -
MenaceX^ - 08.08.2009
He could also use it in OnPlayerStateChange.
Re: How to automatically delete car after player exits? I have this so far.. -
ThePS3Guy - 08.08.2009
Ok thanks. I will check that out. In the future I plan on making it so that if they get back in, it stops it from deleting, but not good enough yet. thanks
Re: How to automatically delete car after player exits? I have this so far.. -
ThePS3Guy - 08.08.2009
OK, so I got this and it works:
public OnPlayerExitVehicle(playerid, vehicleid)
{
new currentveh;
currentveh = GetPlayerVehicleID(playerid);
DestroyVehicle(currentveh);
return 1;
}
but how can I make it work with onplayerstatechange? because I am a pretty new scripter, and after reading through more than 1 pawno manual it's still very confusing... im learning as i go though. i think i have onplayerexitvehicle down, but can someone help me out with using this script with onplayerstatechange?
Re: How to automatically delete car after player exits? I have this so far.. -
Westie - 08.08.2009
Quote:
Originally Posted by ThePS3Guy
...
|
Looking at the useless code there, you could save yourself three cycles by doing something like this:
pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
DestroyVehicle(vehicleid);
}
Of course, you would have to add some checking, because if a passenger left the car, then that would be destroyed.
Talking of OnPlayerStateChange, go read the
wiki, as well as the article about states. You can check if a player is the vehicle driver, then delete - job done.
Re: How to automatically delete car after player exits? I have this so far.. -
ThePS3Guy - 08.08.2009
Thanks We(stie) I see what you did there and why (which surprises me

) thanks.
but can anybody still help me with the onplayerstatechange please?
EDIT: wait didnt see that link u gave