Radio Problem
#1

Can anyone show me how to turn off radio automatic when i leave vehicle.



// play an internet radio stream
if(strcmp(cmdtext, "/radioon", true) == 0)
if(IsPlayerInAnyVehicle(playerid))
{
PlayAudioStreamForPlayer(playerid, "http://somafm.com/beatblender.pls");
return 1;
}
// stop the internet radio stream
if(strcmp(cmdtext, "/radiooff", true) == 0)
if(IsPlayerInAnyVehicle(playerid))
{
StopAudioStreamForPlayer(playerid);
return 1;
Reply
#2

// stop the internet radio stream
pawn Код:
if(strcmp(cmdtext, "/radiooff", true) == 0) {
 if(!IsPlayerInAnyVehicle(playerid))
 {
 StopAudioStreamForPlayer(playerid);
 return 1;
 }
 }
Reply
#3

you mean when player leave vehicle then here is code..
Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
StopAudioStreamForPlayer(playerid);
    return 1;
}
Reply
#4

That is the same thing man
Reply
#5

Quote:
Originally Posted by Hansolue
Посмотреть сообщение
That is the same thing man
thats what you wanted right ?
Reply
#6

when i leave vehicle i can still hear music,i want to stop radio automatic when i leave vehicle
Reply
#7

Quote:
Originally Posted by Hansolue
Посмотреть сообщение
when i leave vehicle i can still hear music,i want to stop radio automatic when i leave vehicle
Me and sufyan already gave you the code for that, read post #2 and #3.
Reply
#8

try what sufyan wrote

Quote:
Originally Posted by Sufyan
Посмотреть сообщение
you mean when player leave vehicle then here is code..
Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
StopAudioStreamForPlayer(playerid);
    return 1;
}
Reply
#9

i try that and nothing
Reply
#10

Quote:
Originally Posted by Hansolue
Посмотреть сообщение
i try that and nothing
are you still hearing the music even after you left the vehicle ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)