Vehicle Death Problem
#1

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

Try moving the StopAudioStreamForPlayer(playerid); above DestroyObject(sheminal[vehicleid][0]);
As now it is removing the vehicle/object and then stopping the stream.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)