Jump to content

Plug.dj like server radio


papam77

Recommended Posts

Required Arguments for playSound:

soundPath: The filepath to the sound file you want to play. (Sound file has to be predefined in the meta.xml file with tag.)

Required Arguments for playSound3D

soundPath: The filepath to the sound file you want to play. (Sound file has to be predefined in the meta.xml file with tag. And also can use url instead of filepath )

x: A floating point number representing the X coordinate on the map.

y: A floating point number representing the Y coordinate on the map.

z: A floating point number representing the Z coordinate on the map.

Link to comment

mtaserver.conf:

    EAG| |TSR| // Scripting Server
    
    22012
    25
    1
    22012
    
    1
    
    5
    20
    --  --> 
    
    
    1
    
    
    1
    0
    85219
    medium
    1
    server-id.keys
    logs/server.log
    logs/server_auth.log
    logs/db.log
    acl.xml
    logs/scripts.log
    0
    0
    61
    0
    0
    1
    4
    -- 24600 --> 
    backups
    1
    3
    "admin" startup="1" protected="0" /> 

  

client.lua:

addEventHandler( 'onClientResourceStart', resourceRoot, 
    function( ) 
    local uSound = playSound3D( 'http://plug.dj/eag-tsr-gaming/', 359.14141, 173.59044, 1008.32, false )  
        setSoundMaxDistance( uSound, 1000 ) 
    end 
) 

Error:

Download error: HTTP server file mismatch (EagleSystem) client.lua

EAG|DeeJay: HTTP server file mismatch (EagleSystem) client.lua

Link to comment
Required Arguments for playSound:
soundPath: The filepath to the sound file you want to play. (Sound file has to be predefined in the meta.xml file with tag.)

Required Arguments for playSound3D

soundPath: The filepath to the sound file you want to play. (Sound file has to be predefined in the meta.xml file with tag. And also can use url instead of filepath )

x: A floating point number representing the X coordinate on the map.

y: A floating point number representing the Y coordinate on the map.

z: A floating point number representing the Z coordinate on the map.

The difference between these functions is only the coordinate on the map. It wont help him to create his Plug.DJ radio.

It's not too hard to understand...

Plug.DJ use Youtube as music provider. If you attemp to convert a Youtube video and play it with MTA then you can make your Plug.DJ radio.
Link to comment
So how to do it? I don't understand now.

You use the Plug.DJ API to get the current song Youtube URL. After that, you convert this Youtube URL in a mp3 file and save it in your website folder. With LUA, you get this converted mp3 and you start it in your server.

Now, to be more realist.

  • Convert a Youtube Video is very slow.
  • Convert a Youtube Video use much website ram

Hope you understand.

Link to comment
Required Arguments for playSound:
soundPath: The filepath to the sound file you want to play. (Sound file has to be predefined in the meta.xml file with tag.)

Required Arguments for playSound3D

soundPath: The filepath to the sound file you want to play. (Sound file has to be predefined in the meta.xml file with tag. And also can use url instead of filepath )

x: A floating point number representing the X coordinate on the map.

y: A floating point number representing the Y coordinate on the map.

z: A floating point number representing the Z coordinate on the map.

playSound also can play live stream URL's , my radio is using it ....

Link to comment

Create an account or sign in to comment

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

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...