Streaming for all vehicle pessengers
#1

I Did that CMD :

PHP код:
         if(strcmp(cmd"/Setradio"true) == 0)
        {
            if(!
IsPlayerInAnyVehicle(playerid))
                {
                    
SendClientMessage(playerid,COLOR_GREY,"   You are not in a vehicle!");
                    return 
1;
                }
            
ShowPlayerDialog(playerid1213DIALOG_STYLE_LIST"Car Radio""{FF0000}My Songs""Choose""Exit");
            return 
1;
    } 
It's working - but how to make it that only The driver can use it and once he do that all the Vehicle Pessengers hear it ? and that if player enter the vehicle while it's working the music works for him too - i really need help guys - PLease
Reply
#2

You have to modify the dialog's code, not command's. Show us your car radio dialog
Reply
#3

Here :
PHP код:
            switch(listitem)
            {
                case 
0:
                {
                    if(
playing[playerid] == 1)
                    {
                        
playing[playerid] = 0;
                        
GameTextForPlayer(playerid"~w~Music ~r~stopped"30003);
                        
StopAudioStreamForPlayer(playerid);
                    }
                    else
                    {
                        
SendClientMessage(playeridcolor_wa"- You aren't playing music -");
                    }
                }
                case 
1:
                {
                    
playing[playerid] = 1;
                    
GameTextForPlayer(playerid"~w~Music ~g~started"30003);
                    
PlayAudioStreamForPlayer(playerid"http://83.87.110.147/files/music/cl_01.mp3");
                    
/*
                    If you navigate to:
                    - http://83.87.110.147/files/music/
                    - http://83.87.110.147/files/
                    or
                    - http://83.87.110.147/
                    The webserver will return: "Not Found".
                    This does NOT mean the .mp3 files aren't available.
                    The .mp3 files are hosted 24/7 at a professional webserver system.
                    The reason why there isn't a .com domain is because it is not needed.
                    That is why it is just the IP address of the webserver.
                    Any attempt to hack or take down the webserver will be logged.
                    Also, your IP address will be reported to the France minister of internet crime and your ISP.
                    */
                
}
                case 
2:
                {
                    
playing[playerid] = 1;
                    
GameTextForPlayer(playerid"~w~Music ~g~started"30003);
                    
PlayAudioStreamForPlayer(playerid"http://83.87.110.147/files/music/du_01.mp3");
                }
                case 
3:
                {
                    
playing[playerid] = 1;
                    
GameTextForPlayer(playerid"~w~Music ~g~started"30003);
                    
PlayAudioStreamForPlayer(playerid"http://83.87.110.147/files/music/el_01.mp3");
                }
                case 
4:
                {
                    
playing[playerid] = 1;
                    
GameTextForPlayer(playerid"~w~Music ~g~started"30003);
                    
PlayAudioStreamForPlayer(playerid"http://83.87.110.147/files/music/hi_01.mp3");
                }
                case 
5:
                {
                    
playing[playerid] = 1;
                    
GameTextForPlayer(playerid"~w~Music ~g~started"30003);
                    
PlayAudioStreamForPlayer(playerid"http://83.87.110.147/files/music/ho_01.mp3");
                }
                case 
6:
                {
                    
playing[playerid] = 1;
                    
GameTextForPlayer(playerid"~w~Music ~g~started"30003);
                    
PlayAudioStreamForPlayer(playerid"http://83.87.110.147/files/music/ja_01.mp3");
                }
                case 
7:
                {
                    
playing[playerid] = 1;
                    
GameTextForPlayer(playerid"~w~Music ~g~started"30003);
                    
PlayAudioStreamForPlayer(playerid"http://83.87.110.147/files/music/me_01.mp3");
                }
                case 
8:
                {
                    
playing[playerid] = 1;
                    
GameTextForPlayer(playerid"~w~Music ~g~started"30003);
                    
PlayAudioStreamForPlayer(playerid"http://83.87.110.147/files/music/po_01.mp3");
                }
                case 
9:
                {
                    
playing[playerid] = 1;
                    
GameTextForPlayer(playerid"~w~Music ~g~started"30003);
                    
PlayAudioStreamForPlayer(playerid"http://83.87.110.147/files/music/rn_01.mp3");
                }
                case 
10:
                {
                    
playing[playerid] = 1;
                    
GameTextForPlayer(playerid"~w~Music ~g~started"30003);
                    
PlayAudioStreamForPlayer(playerid"http://83.87.110.147/files/music/ro_01.mp3");
                }
            }
        } 
Reply
#4

Guys , I Really need urgent help.. Please
Reply
#5

for loop thought all players

-> GetPlayerVehicleSeat(i)==1||GetPlayerVehicleSeat(i )==2||GetPlayerVehicleSeat(i)==3||GetPlayerVehicle Seat(i)==4

PlayerSound(i);



understood?
Reply
#6

No.. :S - Can you Explain more please ?
Reply
#7

GetPlayerState(playerid, PLAYER_STATE_DRIVER)
That would do it!
Reply
#8

Yeah , But the problem that how to make it Stream for all Vehicle Passengers ?
Reply
#9

I think using GetVehicleID and loop true all players. If the vehicle id matches then play it. do not ask how because i dont know
Reply
#10

Well , if anyone can tell how ? It would be really Appreciated.. i am really trying to learn pawno and i am done my best , but it isn't easy (i will rep+)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)