Radio Sync 1.0.0

   (6 reviews)

1 Screenshot

About This File

This script, sync Driver Radio to all Other Passangers...

INSTALL :

Simple....
put the files in the Folders as defined.
in client_packages/index.js put 

Zitat

require('radioSync');

 

Finish :)
i Hope it worked for u

 

EDIT : A Update is currently in work

  • Like 4
  • Confused 1



User Feedback

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest

Tosfera

   4 of 4 members found this review helpful 4 / 4 members

The sync itself should work, but it's not the best way to go. I would rather listen to the player changing the radio (limit it to the driver or the person next to the driver) and then sync the radio with everyone. You're currently just creating endless timers for no reason.

Response from the author:

A Update is currently in progress, i respect ur answer. And look at this point how I stable change this. For the best performance.

Share this review


Link to review
Marjo

   1 of 1 member found this review helpful 1 / 1 member

It's nice but when i added this script, all in-game HUDs disappeared. Including ESC Menu, Weapon Selector etc.

Response from the author:

Oh, sry for that. i will look if i can see why this happend, but i dont know why it reacts with the HUD´s.

 

if the "Radio change to : " notice pop off?

Share this review


Link to review
hubba

   1 of 1 member found this review helpful 1 / 1 member

wow,  thanks for that sync....

 

synchronizations officer approved....

Response from the author:

Thank u, always send some bugs if u find one, or some idea to do it better

Share this review


Link to review
tonihenkel

· Edited by tonihenkel

  

Update for better view index.js (Server-Side) - Show Radio Channel, not the Number of Channel!

 

mp.events.add('radiochange', (player, vehicle_data) => {
    player.vehicle.setVariable('radio', vehicle_data);
    var vehicle_data_output = "";
    if(vehicle_data ==  0){ vehicle_data_output = "Los Santos Rock Radio"; }
    if(vehicle_data ==  1){ vehicle_data_output = "Non-Stop FM"; }
    if(vehicle_data ==  2){ vehicle_data_output = "Radio Los Santos"; }
    if(vehicle_data ==  3){ vehicle_data_output = "Channel X"; }
    if(vehicle_data ==  4){ vehicle_data_output = "Westcoast Talk Radio"; }
    if(vehicle_data ==  5){ vehicle_data_output = "Rebel Radio"; }
    if(vehicle_data ==  6){ vehicle_data_output = "Soulwax FM"; }
    if(vehicle_data ==  7){ vehicle_data_output = "East Los FM"; }
    if(vehicle_data ==  8){ vehicle_data_output = "Westcoast Klasse"; }
    if(vehicle_data ==  9){ vehicle_data_output = "Blue Ark"; }
    if(vehicle_data == 10){ vehicle_data_output = "Worldwide FM"; }
    if(vehicle_data == 11){ vehicle_data_output = "Flylo FM"; }
    if(vehicle_data == 12){ vehicle_data_output = "The Lowdown 91.1"; }
    if(vehicle_data == 13){ vehicle_data_output = "The Lab"; }
    if(vehicle_data == 14){ vehicle_data_output = "Radio Mirror Park"; }
    if(vehicle_data == 15){ vehicle_data_output = "Space 103.2"; }
    if(vehicle_data == 16){ vehicle_data_output = "Vinewood Bouleyard Radio"; }
    if(vehicle_data == 17){ vehicle_data_output = "Blonded Los Santos 97.8"; }
    if(vehicle_data == 18){ vehicle_data_output = "L.S. Underground Radio"; }
    if(vehicle_data == 19){ vehicle_data_output = "Self Radio"; }
    if(vehicle_data == 255){ vehicle_data_output = "Ausgeschalten"; }
    player.notify("Geändert auf Kanal " + vehicle_data +":\n " + vehicle_data_output);
});

 

------------

Update for better view index.js (Client-Side) - The Driver and Co-Driver becames the Notification!

 

mp.events.add('playerEnterVehicle', (vehicle, seat) => {
    setInterval(function(){radio_sync();},1000);
});

 

function radio_sync() {
    var player = mp.players.local;
    if(player.vehicle){
    if(player.vehicle.getVariable('radio') == null){
        var radio_index = 0;
    }else{
        var radio_index = player.vehicle.getVariable('radio');
    }

        if (player.vehicle && player.vehicle.getPedInSeat(-1) === player.handle) // Check if player is in vehicle and is driver
        {
            if(radio_index != mp.game.invoke("0xE8AF77C4C06ADC93")){
            radio_index = mp.game.invoke("0xE8AF77C4C06ADC93");
            mp.events.callRemote('radiochange', radio_index);
            }
        }else{
            if(radio_index == 255){
                mp.game.audio.setRadioToStationName("OFF");
            }else{
                mp.game.invoke("0xF7F26C6E9CC9EBB8", true);
                mp.game.invoke("0xA619B168B8A8570F ", radio_index);
                mp.events.callRemote('radiochange', radio_index);
            }
            
        }
    }
};

 

 

----

Tested and Works. Hav- Fun :)

  • Like 1

Share this review


Link to review
TimFL

  

Try the playerEnterVehicle event on the server-side and send a client event trigger from there (e.g. "playerInVehicleNow" on clientside to start the timer).

The server-side event fires when the player sits in the car (not when they start to get into it). Store the setInterval object in a variable so you can check whether it's already running and destroy it when a player leaves their vehicle.

Share this review


Link to review
SuperiorUser

  

Thanks!

Share this review


Link to review