xXGhostXx

Play Sound

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 !

Share this post


Link to post

There is a tutorial for learning server client communication:

 

Share this post


Link to post
2 hours ago, IIYAMA said:

There is a tutorial for learning server client communication:

 

This your help ? :(

@Galactix Please help me !

Share this post


Link to post
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!

Share this post


Link to post
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

Share this post


Link to post
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 :(

Share this post


Link to post
11 hours ago, Keiichi1 said:

You won't get help with this attitude, trust me. Start learning...

Please just this time for your help :(

Share this post


Link to post
2 hours ago, Mσнαмα∂ Hєℓιѕн said:

bos bede komaket konam eshgham :D

 

English dude...

Share this post


Link to post
17 hours ago, xXGhostXx said:

This your help ? :(

@Galactix Please help me !

It is :santa:, take it or leave it. But don't be so ungrateful.

Share this post


Link to post

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.