Jump to content

sound


Recommended Posts

اسلام عليكم

طبعا انا عندي مشكلة في صوت

لما اشغل صوت لاعبين ما يسمعو صوت

وهذا الاكواد كلنت

  
function music()  
    local sound = playSound("music/sound.mp3")  
    setSoundVolume(sound, 50)  
    setSoundMaxDistance( sound, 5000 ) 
    triggerServerEvent("sound", getLocalPlayer())  
end 
addCommandHandler("music.sound", music ) 
  

طبعا انا سويتها بس

كيف بدي اخليها للادمن

او

للفريق

وشكرا :]

Link to comment

اعطيك الكود كلنت و سيرفر وتشوف وش الحل

وهذا كلنت

function music() 
    local sound = playSound("music/sound.mp3") 
    setSoundVolume(sound, 50) 
    setSoundMaxDistance( sound, 5000 ) 
    triggerServerEvent("sound", getLocalPlayer()) 
end 
addCommandHandler("music.sound", music ) 

هذا سيرفر

addEvent("sound", true)  
addEventHandler("sound", root,  
function () 
    local name = getPlayerName(source) 
    local r,g,b = getPlayerNametagColor ( source ) 
        outputChatBox ( "" .. name .. ": #2600FF start sound.", getRootElement(), r, g, b, true ) 
end 
) 

Link to comment

client :

function music() 
    local sound = playSound("music/sound.mp3") 
setSoundVolume(sound, 50) 
    setSoundMaxDistance( sound, 5000 ) 
end 
addEvent( "sound", true ) 
addEventHandler( "sound", getRootElement(), music ) 
  

server :

function music() 
triggerClientEvent ( "sound", getRootElement(), 
end 
addCommandHandler("music.sound", music ) 

Link to comment

تمام اشتغل

طيب اخر شيء وين بدي احط هذا الكود

  
    local name = getPlayerName(source) 
    local r,g,b = getPlayerNametagColor ( source ) 
        outputChatBox ( "" .. name .. ": #2600FF start sound.", getRootElement(), r, g, b, true ) 

كمان مسموح للادمن يستعملة

Link to comment

تفضل اخوي

client

  
addEvent("start",true) 
function music() 
    local sound = playSound("music/sound.mp3") 
    setSoundVolume(sound, 50) 
    setSoundMaxDistance( sound, 5000 ) 
    triggerServerEvent("sound", getLocalPlayer()) 
end 
addEventHandler("start",root,music) 
  

server

addEvent("sound", true)  
addEventHandler("sound", root,  
function () 
    local name = getPlayerName(source) 
    local r,g,b = getPlayerNametagColor ( source ) 
        outputChatBox ( "" .. name .. ": #2600FF start sound.", getRootElement(), r, g, b, true ) 
end 
) 
  
addCommandHandler("music.sound", function () 
triggerClientEvent(root,"start",root) 
end 
) 
  
Link to comment

server side

function music(player, cmd) 
local name = getPlayerName(player) 
local r,g,b = getPlayerNametagColor (player) 
outputChatBox ( "" .. name .. ": #2600FF start sound.", getRootElement(), r, g, b, true ) 
triggerClientEvent ("sound", getRootElement()) 
end 
addCommandHandler("music.sound", music) 

Link to comment

function music(player, cmd) 
local name = getPlayerName(player) 
local r,g,b = getPlayerNametagColor (player) 
local accountname = getAccountName (getPlayerAccount(player)) 
if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then 
outputChatBox ( "" .. name .. ": #2600FF start sound.", getRootElement(), r, g, b, true ) 
triggerClientEvent ("sound", getRootElement()) 
else outputChatBox ( "this command for admin group", player, 255, 0, 0, true ) return end 
end 
addCommandHandler("music.sound", music) 
Link to comment
  
-- # Server Side ! 
function music(player, cmd) 
local name = getPlayerName(player) 
local r,g,b = getPlayerNametagColor (player) 
local accountname = getAccountName (getPlayerAccount(player)) 
if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then 
outputChatBox ( "" .. name .. ": #2600FF start sound.", getRootElement(), r, g, b, true ) 
triggerClientEvent (getRootElement(),"sound", getRootElement()) 
else outputChatBox ( "this command for admin group", player, 255, 0, 0, true ) return end 
end 
addCommandHandler("music.sound", music) 
  

اصلاح للكود كان في غلط في الترايقر للكلنت .. :wink:

Link to comment
  
-- # Server Side ! 
function music(player, cmd) 
local name = getPlayerName(player) 
local r,g,b = getPlayerNametagColor (player) 
local accountname = getAccountName (getPlayerAccount(player)) 
if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then 
outputChatBox ( "" .. name .. ": #2600FF start sound.", getRootElement(), r, g, b, true ) 
triggerClientEvent (getRootElement(),"sound", getRootElement()) 
else outputChatBox ( "this command for admin group", player, 255, 0, 0, true ) return end 
end 
addCommandHandler("music.sound", music) 
  

اصلاح للكود كان في غلط في الترايقر للكلنت .. :wink:

ما يحتاج ذذ

Link to comment
تفضل اخوي

client

  
addEvent("start",true) 
function music() 
    local sound = playSound("music/sound.mp3") 
    setSoundVolume(sound, 50) 
    setSoundMaxDistance( sound, 5000 ) 
    triggerServerEvent("sound", getLocalPlayer()) 
end 
addEventHandler("start",root,music) 
  

server

addEvent("sound", true)  
addEventHandler("sound", root,  
function () 
    local name = getPlayerName(source) 
    local r,g,b = getPlayerNametagColor ( source ) 
        outputChatBox ( "" .. name .. ": #2600FF start sound.", getRootElement(), r, g, b, true ) 
end 
) 
  
addCommandHandler("music.sound", function () 
triggerClientEvent(root,"start",root) 
end 
) 
  
يسلمووو علي كل شيء

طيب بدي اخلية مسموح للادمن

  
isObjectInACLGroup -- اذا كنت تبيه لقروب مخصص 
hasObjectPermissionTo -- اذا كنت تبيه لخاصيه معينه مثل كل الي تفتح لهم لوحة الأدمنيه 
  
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...