Vehicle Radio
#1

I have made a radio thing but now I want the url that the player has set the radio to will set it for all the people who are in or are getting to the car will hear, How would I do this? If so could you please leave me an example below thanks.
Reply
#2

If you want to set the radio for all players:
-make a global variable:
pawn Код:
new radio[128] = "http://radio.com"; //just an example
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
     if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
     {
          PlayAudioStreamForPlayer(playerid,radio);
     }
     if(oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER)
     {
          PlayAudioStreamForPlayer(playerid,"Radio Stopped");
      }
}
If you want you can make a CMD to change the variable "radio".

Or you can make variable radio[MAX_PLAYERS][128]; and every player can change the stations only for them not for all players(with a dialog box or command etc.)

If you want my radio from my gm i will post it here , but is best for you to make it yourself so you can understant and learn all this
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)