Vehicle Death Problem - 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 Death Problem (
/showthread.php?tid=522770)
Vehicle Death Problem -
Pboachie - 29.06.2014
How can i make it so that when a vehicle a player is in is destroyed, it stops streaming the radio.
Here is what i tried but gave me an error
PHP код:
public OnVehicleDeath(playerid, vehicleid)
{
DestroyObject(sheminal[vehicleid][0]);
DestroyObject(sheminal[vehicleid][1]);
DestroyObject(sheminal[vehicleid][2]);
DestroyObject(sheminal[vehicleid][3]);
sheminalll[vehicleid] = 0;
StopAudioStreamForPlayer(playerid);
return 1;
This is what it originally was with no errors
PHP код:
public OnVehicleDeath(vehicleid)
{
DestroyObject(sheminal[vehicleid][0]);
DestroyObject(sheminal[vehicleid][1]);
DestroyObject(sheminal[vehicleid][2]);
DestroyObject(sheminal[vehicleid][3]);
sheminalll[vehicleid] = 0;
return 1;
}
Iv already done onplayerexitvehicle, but i want it to also stop when something happens to the veh
Re: Vehicle Death Problem -
MotherDucker - 29.06.2014
Try moving the StopAudioStreamForPlayer(playerid); above DestroyObject(sheminal[vehicleid][0]);
As now it is removing the vehicle/object and then stopping the stream.