M7MD# Posted May 19, 2015 Share Posted May 19, 2015 السلام عليكم عدلت على مود حق صوت الشات لما حد يتكلم في الشات يطلع صوت لكن اضفت تحقق وهو ان اذا اللاعب كان في قروب الكوسنول فقط يطلع صوت لكن حصل خطأ مدري وش هو server function chat (thePlayer) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Console" ) ) then triggerClientEvent("sonido",getRootElement()) end end addEventHandler ( "onPlayerChat", getRootElement(), chat ) ================ client function playSonido() local sound = playSound("chat.mp3",false) setSoundVolume(sound, 0.9) end addEvent("sonido",true) addEventHandler("sonido",getRootElement(),playSonido) Link to comment
The Killer Posted May 19, 2015 Share Posted May 19, 2015 Server side # addEventHandler ("onPlayerChat", root, function (plr) local accName = getAccountName (getPlayerAccount (plr)) if isObjectInACLGroup ("user." .. accName, aclGetGroup ("Console")) then triggerClientEvent (root, "PlaySound", plr) end end ) Client side # addEvent ("PlaySound", true) addEventHandler ("PlaySound", root, function () local sound = playSound("chat.mp3", false) setSoundVolume(sound, 0.9) end ) Link to comment
Walid Posted May 19, 2015 Share Posted May 19, 2015 Server side # addEventHandler ("onPlayerChat", root, function (plr) local accName = getAccountName (getPlayerAccount (plr)) if isObjectInACLGroup ("user." .. accName, aclGetGroup ("Console")) then triggerClientEvent (root, "PlaySound", plr) end end ) خطأ it must be like this addEventHandler ("onPlayerChat", root, function (message, messageType) if messageType == 0 then local accName = getAccountName (getPlayerAccount (source)) if isObjectInACLGroup ("user." .. accName, aclGetGroup ("Console")) then triggerClientEvent (root, "PlaySound", source) end end end ) The source of this event is the player who sent the chatbox message. Link to comment
The Killer Posted May 19, 2015 Share Posted May 19, 2015 اوه صحيح مشكور ع التعديل هو بس خربطني لأنه حاط اللاعب # Link to comment
M7MD# Posted May 20, 2015 Author Share Posted May 20, 2015 مشكورين على المسآعدة ممكن تقول وين كانت المشكلة عشان لآ تتكرر ؟ Link to comment
The Killer Posted May 20, 2015 Share Posted May 20, 2015 triggerClientEvent("sonido",getRootElement()) -- هنا ناقص ارقمنت الي بيظهر له الكلام -- يصير كذا triggerClientEvent(root, "sonido", source) Link to comment
TAPL Posted May 22, 2015 Share Posted May 22, 2015 triggerClientEvent("sonido",getRootElement()) -- هنا ناقص ارقمنت الي بيظهر له الكلام -- يصير كذا triggerClientEvent(root, "sonido", source) root ما له علاقة، الأرقمنت ذا اختياري مو اجباري و إذا ما حطه تلقائي يصير onPlayerChat كان مستخدم بارتمر في الأفنت الأفنت ذا اول بارتمار فيه هو الكلام الي انكتب بالشات ماهو اللاعب الي كتب في الشات هو اللاعب الي كتب في الشات و هو الي المفترض تجيب الأكاونت حقه onPlayerChat السورس في الأفنت Link to comment
The Killer Posted May 22, 2015 Share Posted May 22, 2015 مشكور ع المعلومه , وبالنسبه للاعب في الايفنت onPlayerChat هو لنه حط فيه اللاعب فخربطني معه , ونسيت انه السورس هو اللاعب Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now