[HELP] Vehicle destroy
#1

Hey guys. So, I have a car script, and wanna create function which will destroy vehicle after she death (becouse without destroying it appears in spawn).
Okay. I was creating destroy script in callback OnVehicleDeath like this:

PHP код:
if(CreateCar[playerid] != -1)
{
DestroyVehicle(CreateCar[playerid]);
CreateCar[playerid] = -1;

But then i get errors about playerid, becouse OnVehicleDeath cannot read playerid......

I was trying to create script like this
PHP код:
public OnVehicleDeath(vehicleidkillerid)
{
for(new 
playerid;playerid<MAX_PLAYERS;playerid++)
{
if(
CreateCar[playerid] != -1)
{
DestroyVehicle(CreateCar[playerid]);
CreateCar[playerid] = -1;
}
}
return 
1;

But after destroying, vehicles is disappears for all server players.

Please help!
Reply


Messages In This Thread
[HELP] Vehicle destroy - by beasty - 03.01.2013, 10:04
Re: [HELP] Vehicle destroy - by Konstantinos - 03.01.2013, 10:13
Re: [HELP] Vehicle destroy - by beasty - 03.01.2013, 11:02
Re: [HELP] Vehicle destroy - by Konstantinos - 03.01.2013, 11:29

Forum Jump:


Users browsing this thread: 1 Guest(s)