Jump to content

Music script


Recommended Posts

Posted

Hello, i need help with this script i want add

getPlayerName 

Function here is the lua

function cmdPlaySound(cmd, file) 
    if not file then 
        return outputChatBox("[uSAGE] /startmusic [name]", getLocalPlayer()); 
    end 
     
    if playSound("sounds/" .. file .. ".mp3") then 
        outputChatBox(Is Playing "  .. file,255,255,255); 
    end 
end 
  
addCommandHandler("startmusic", cmdPlaySound); 
 

i want when player start music it show on chatbox like example

    if playSound("sounds/" .. file .. ".mp3") then 
        outputChatBox(..getPlayerName..#0096FFIs Playing "  .. file,255,255,255); 
    end 
  
 

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted

anything ?

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted

To output the message to every one in chat, You'll have to send a trigger to the server-side, Because outputChatBox client-side dosn't have a element argument .

I'v fixed the code, The trigger is on you ;) :

function cmdPlaySound( cmd, file ) 
    if not file then 
        return outputChatBox( "[uSAGE] /startmusic [name]" ) 
    end 
    
    if playSound ( "sounds/" .. file .. ".mp3" ) then 
        outputChatBox( "Is Playing "  .. file, 255, 255, 255 ) 
    end 
end 
addCommandHandler( "startmusic", cmdPlaySound ) 

" Keep Thinking Different . " - Steve Jops

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

Don't send me PMs asking for help, I Won't reply !

Posted

no no not that, when a player start the music i want to show like example

Steven:Is playing..file..

Anything else ?

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted

HELP !

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted

Well, you'll have to either make command server side, and then trigger to play the sound, or make a trigger from the client side to show what is the player playing.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

i have server side here is it

  
function cmdInstallSound(player, cmd, file) 
    if not file then 
        outputChatBox("[uSAGE] /installsound [sound name]", player); 
    end 
     
    local xml, soundNode; 
     
    xml = xmlLoadFile(":soundplayer/meta.xml"); 
    soundNode = xmlCreateChild(xml, "file"); 
     
    xmlNodeSetAttribute(soundNode, "src", "sounds/" .. file .. ".mp3"); 
     
    xmlSaveFile(xml); 
    xmlUnloadFile(xml); 
     
    if restartResource(getThisResource()) then 
        outputChatBox("The sound file is installed, use /playsound " .. file, player); 
    else 
        outputChatBox("Restart this resource please", player); 
    end 
end 
  
addCommandHandler("installsound", cmdInstallSound); 

can you do it to me please

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted

Can you at least try to do it?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

ok what i need to do now ?

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted

I already told you what to do.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

can you make it to me please :'(

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted

i dont know how to make it :(

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted

Well he's not gonna help until you try .

" Keep Thinking Different . " - Steve Jops

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

Don't send me PMs asking for help, I Won't reply !

Posted
:P and i will never success, just give me an example.

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted

Can somebody help me ?

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted

yes :)

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted

or a lua...

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted

The functions you have to use already got examples on the wiki, but you obviously ignore them.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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...