SA-MP Forums Archive
Vehicle destroy - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Vehicle destroy (/showthread.php?tid=638068)



Vehicle destroy - ,TomY' - 26.07.2017

Hi. I want to do, that when player leave car, it will destroy. Here I have code. It works, but vehicle wont destroy, but respawning...

Код:
 if( oldstate == PLAYER_STATE_DRIVER && newstate == PLAYER_STATE_ONFOOT && IsValidVehicle(veho[playerid]))
    {
        timer[ playerid ] = SetTimerEx( "destroytimer", 120000, false, "i", playerid );
    }
Код:
forward destroytimer( playerid );
public destroytimer( playerid )
{
    DestroyVehicle(veho[playerid]);
    return 1;
}



Re: Vehicle destroy - Xtra - 26.07.2017

destroy vehicles mean's its self re-spawning use givevehiclehealth
Код:
new vID = GetPlayerVehicleID(playerid);
	GetVehiclePos(vID, x, y, z), SetVehicleHealth(vID, 0), CreateExplosion(x, y, z, 12, 20);



Re: Vehicle destroy - ,TomY' - 26.07.2017

Quote:
Originally Posted by Xtra
Посмотреть сообщение
destroy vehicles mean's its self re-spawning use givevehiclehealth
Код:
new vID = GetPlayerVehicleID(playerid);
	GetVehiclePos(vID, x, y, z), SetVehicleHealth(vID, 0), CreateExplosion(x, y, z, 12, 20);
Still respawning :/


Re: Vehicle destroy - ,TomY' - 26.07.2017

Still need help :S


Re: Vehicle destroy - Xtra - 26.07.2017

Quote:
Originally Posted by ,TomY'
Посмотреть сообщение
Still need help :S
Код:
  new vehicleid = GetPlayerVehicleID(playerid);
    SetVehicleHealth(vehicleid, 5);
it will make your vehicle start burning at the very least , ( is there something in your script which is making the vehicle respawn ? )