25.05.2017, 05:05
If you mean you want to stop the sound when the player is leaving the vehicle,
Use this code. This callback will be called when the player leaves any vehicle he is in, and you can stop the audio for him.
https://sampwiki.blast.hk/wiki/StopAudioStreamForPlayer
https://sampwiki.blast.hk/wiki/OnPlayerStateChange
Use this code. This callback will be called when the player leaves any vehicle he is in, and you can stop the audio for him.
https://sampwiki.blast.hk/wiki/StopAudioStreamForPlayer
https://sampwiki.blast.hk/wiki/OnPlayerStateChange
Код:
public OnPlayerStateChange(playerid, newstate, oldstate) { // If the player exits a vehicle if(oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER) { StopAudioStreamForPlayer(playerid); // Stop the audio stream } return 1; }