How to automatically delete car after player exits? I have this so far..
#1

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)
Reply
#2

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
Reply
#3

He could also use it in OnPlayerStateChange.
Reply
#4

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
Reply
#5

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?
Reply
#6

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.
Reply
#7

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)