[JS, CEF] Internet Radio 1.0.1

   (2 reviews)
Sign in to follow this  

1 Screenshot

About This File

Internet radio over colshapes using CEF.

Scope of application: custom clubs, interiors.

Default location is the Galileo Observatory (behind the monument).

Default radio station - Wacken Radio (DE).

Installation:

I. Put server files to: server-files\packages\yourGameMode

II. Add require('./rStreamColshapes');  to your server's index.js

III. Put client files to: client_packages then edit your client's index.js and add require('./rStream');

To change radio stream url, edit index.html here: client_packages\cef\rStream\index.html

 

GitHub


What's New in Version 1.0.1   See changelog

Released

Reworked CEF and scripts, thanks to Loxitation




User Feedback

Create an account or sign in to leave a review

You need to be a member in order to leave a review

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Loxitation

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

Hey, I've re-worked your script a little bit to fix the error that you call the radio in every colshape.

 

Serverside:

Spoiler

function playerEnterColshapeHandler(player, shape) {
    if(shape == rStreamColshape) {
        player.notify(`Radio stream started`);
        player.call("cRadio-Start", []);
    }
}
mp.events.add("playerEnterColshape", playerEnterColshapeHandler);

function playerExitColshapeHandler(player, shape) {
    if(shape == rStreamColshape) {
        player.notify(`Radio stream stopped`);
        player.call("cRadio-Stop", []);
    }
}
mp.events.add("playerExitColshape", playerExitColshapeHandler);

//Calling the CEF with player.call"cRadio[...]"

and clientside

Spoiler

let rStream = null;


mp.events.add(
{
    "cRadio-Start" : () => {
        rStream = mp.browsers.new('package://RP/Browsers/rStream/index.html');
    },
    
    "cRadio-Stop" : (lang, inject) => {
         rStream.destroy();
    },

});

 

 

I hope it helps you out 🙂

Response from the author:

It works, thank you!

  • Like 1

Share this review


Link to review
starkserwf

  

The script works, but now when entering any other collshape the radio stream is turned on. How to fix?

Share this review


Link to review