SA-MP Forums Archive
PlayAudioStreamForPlayer on entering a car - 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: PlayAudioStreamForPlayer on entering a car (/showthread.php?tid=312333)



PlayAudioStreamForPlayer on entering a car - ShawnMiller1337 - 21.01.2012

How would I make it so when you enter a SFPD cop car I can play audio with PlayAudioStreamForPlayer and make it stop when they leave the cop car


Re: PlayAudioStreamForPlayer on entering a car - Tanush123 - 21.01.2012

Under OnPlayerState add
pawn Код:
new modelid = GetVehicleModel(GetPlayerVehicleID(playerid));
if(modelid == /*SFPD Vehicle ID*/)
{
       PlayAudioStreamForPlayer(playerid,"link");
}
Under onplayerexitvehicle
pawn Код:
new modelid = GetVehicleModel(GetPlayerVehicleID(playerid));
if(modelid == /*SFPD Vehicle ID*/)
{
       StopAudioStreamForPlayer(playerid);
}