Jump to content

Play Sound


xXGhostXx

Recommended Posts

Hey guys !

I have a problem to play the sound !

Server side:

function newspm ( thePlayer, _, ... )
    local message = table.concat ( { ... }, " " )
    if ( isPlayerOnGroup ( thePlayer ) ) then
    if ... then
      for index, allpl in ipairs(getElementsByType("player")) do
        outputChatBox ( "(News Reporter)".. getPlayerName ( thePlayer ) ..": #FFFFFF".. message,  allpl,255, 255, 255, true )
      end
    else
      outputChatBox ( "#FFFFFFSyntax: /news <text>", thePlayer, 255, 255, 255, true )
    end
    else
        outputChatBox ( "#ff0000Access Denied!", thePlayer, 255, 255, 255, true )
    end
end
addCommandHandler ( "news", newspm )

Client side:

function newssound()
local message = playSound("pm.mp3",true)
setSoundVolume(message, 0.9)
end

Like this send news for all players play sound !

please answer me !

Link to comment
4 hours ago, xXGhostXx said:

Hey guys !

I have a problem to play the sound !

Server side:


function newspm ( thePlayer, _, ... )
    local message = table.concat ( { ... }, " " )
    if ( isPlayerOnGroup ( thePlayer ) ) then
    if ... then
      for index, allpl in ipairs(getElementsByType("player")) do
        outputChatBox ( "(News Reporter)".. getPlayerName ( thePlayer ) ..": #FFFFFF".. message,  allpl,255, 255, 255, true )
      end
    else
      outputChatBox ( "#FFFFFFSyntax: /news <text>", thePlayer, 255, 255, 255, true )
    end
    else
        outputChatBox ( "#ff0000Access Denied!", thePlayer, 255, 255, 255, true )
    end
end
addCommandHandler ( "news", newspm )

Client side:


function newssound()
local message = playSound("pm.mp3",true)
setSoundVolume(message, 0.9)
end

Like this send news for all players play sound !

please answer me !

 bayad tu client addEventHandler besazi bad to server side triggerClientEvent use koni!

Link to comment
2 hours ago, xXGhostXx said:

This your help ? :(

@Galactix Please help me !

What's your problem? @IIYAMA wants you to learn, not to beg everytime for scripts. You need to understand first how lua works and then you can go with the MTA:SA functions, events.

  • Like 1
Link to comment
12 hours ago, Mσнαмα∂ Hєℓιѕн said:

 bayad tu client addEventHandler besazi bad to server side triggerClientEvent use koni!

What ?!

11 hours ago, Keiichi1 said:

What's your problem? @IIYAMA wants you to learn, not to beg everytime for scripts. You need to understand first how lua works and then you can go with the MTA:SA functions, events.

This is your help ?

please make for me :(

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