twitter Posted October 7, 2016 Share Posted October 7, 2016 السلام عليكم ورحمة الله وبركاته باختصار في مود عاجل حبيت اعدل عليه المشكلة الوحيدة ضفت عليه playSoundFrontEnd ( 49 ) وصار يكرر الاكواد ----- -------طبعآ هذا كلنت لأن سيرفر م عدلت فيه شيء local x,y = guiGetScreenSize(); addEvent ( "3MEED", true ) addEventHandler ( "3MEED", getRootElement(),function(message) txt = message; end) addEventHandler("onClientRender", getRootElement( ),function( ) if ( txt ) then playSoundFrontEnd ( 49 ) dxDrawText ( "#ffFFFF[ #FF0000Admin#FFFFFF ] :", x*(13.0/800), y*(167.0/600), x*(55.0/800), y*(182.0/600), tocolor ( 255, 255, 0, 255 ), 1.0, "default-bold", "left", "top", false, false, false ,true) dxDrawText (txt, x*(60.0/800), y*(168.0/600), x*(799.0/800), y*(224.0/600), tocolor ( 255, 255, 255, 255 ), 1.0, "default-bold", "left", "top", false, false, false ,true) end if ( getElementData(resourceRoot,"PlrAdmin") ) then dxDrawText("#ffffff "..getElementData(resourceRoot,"PlrAdmin"),x*(13.0/800),y*(184.0/600),x*(799.0/800),y*(224.0/600),tocolor(255,255,255,255),0.99,"default-bold","left","top",false,false,false,true) end end) bindKey ( "i", "down", "chatbox", "Admin" ) addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) triggerServerEvent ( "SetMessage", localPlayer ) end ) يليت تساعدوني بأسرع وقت فمان الله Link to comment
N3xT Posted October 7, 2016 Share Posted October 7, 2016 لأنك حاط تشغيل الصوت بداخل حدث ريندر, طبعاً راح يكرر شيله من الريندر وسوي له مثلاً ترايقر أيفنت Link to comment
twitter Posted October 7, 2016 Author Share Posted October 7, 2016 10 minutes ago, N3xT said: لأنك حاط تشغيل الصوت بداخل حدث ريندر, طبعاً راح يكرر شيله من الريندر وسوي له مثلاً ترايقر أيفنت ابغى الكود لأني مبرمج مبتدأ Link to comment
!#NssoR_) Posted October 7, 2016 Share Posted October 7, 2016 اطرح السيرفر و الكلنت كاملين عشان اشوف وين المكان المناسب للصوت 1 Link to comment
twitter Posted October 7, 2016 Author Share Posted October 7, 2016 ابشر -------- سيرفر Groups = { -- القروبات المسموح لها بالكتابة "Admin1", "Admin2", "Console", "Console2", "Head.Admin", "Man-Server", "ACL", } -------------------- لا داعي لتعديل الأكواد تحت هذا السطر ------------------- function check ( thePlayer, commandName, ... ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) local veve = { ... } local message = table.concat ( veve, " " ) for i, v in ipairs ( Groups ) do if isObjectInACLGroup ( "user."..accName, aclGetGroup ( v ) ) then setElementData ( resourceRoot, "MessageAdmin", message); setElementData(resourceRoot,"PlrAdmin",getPlayerName(thePlayer)); SaveMessage ( ) triggerClientEvent ( "3MEED", getRootElement( ), getElementData ( resourceRoot, "MessageAdmin" ) ) end end end addCommandHandler( "Admin", check ) addEventHandler ( "onResourceStart", resourceRoot, function ( ) executeSQLQuery("CREATE TABLE IF NOT EXISTS SaveMessagee (Message, Server)") end ) addEvent ( "SetMessage", true ) addEventHandler ( "SetMessage", root, function ( ) getMessage ( ) end ) SaveMessage = function ( ) local msg = executeSQLQuery ( "SELECT * FROM SaveMessagee WHERE Server = '" .. getServerName ( ) .."'" ) if ( #msg ~= 0 ) then return executeSQLQuery("UPDATE SaveMessagee SET Message=? WHERE Server=? ", tostring ( getElementData ( resourceRoot, "MessageAdmin" ) ), getServerName ( ) ) else return executeSQLQuery("INSERT INTO SaveMessagee (Message,Server) VALUES(?,?)", tostring ( getElementData ( resourceRoot, "MessageAdmin" ) ), getServerName ( ) ) end end getMessage = function ( ) local msg = executeSQLQuery ( "SELECT * FROM SaveMessagee" ) if ( #msg ~= 0 ) then setElementData ( resourceRoot, "MessageAdmin", msg[1]["Message"] ) return setTimer ( triggerClientEvent, 1000, 1, "3MEED", getRootElement( ), getElementData ( resourceRoot, "MessageAdmin" ) ) else return setTimer ( triggerClientEvent, 1000, 1, "3MEED", getRootElement( ), " " ) end end ---------- كلنت -- * Edited By 3MEED local x,y = guiGetScreenSize(); addEvent ( "3MEED", true ) addEventHandler ( "3MEED", getRootElement(),function(message) txt = message; end) addEventHandler("onClientRender", getRootElement( ),function( ) if ( txt ) then dxDrawText ( "#FF0000Admin :", x*(13.0/800), y*(167.0/600), x*(55.0/800), y*(182.0/600), tocolor ( 255, 255, 0, 255 ), 1.0, "default-bold", "left", "top", false, false, false ,true) dxDrawText (txt, x*(60.0/800), y*(168.0/600), x*(799.0/800), y*(224.0/600), tocolor ( 255, 255, 255, 255 ), 1.0, "default-bold", "left", "top", false, false, false ,true) end if ( getElementData(resourceRoot,"PlrAdmin") ) then dxDrawText("#ffffff "..getElementData(resourceRoot,"PlrAdmin"),x*(13.0/800),y*(184.0/600),x*(799.0/800),y*(224.0/600),tocolor(255,255,255,255),1.3,"default-bold","left","top",false,false,false,true) end end) bindKey ( "i", "down", "chatbox", "Admin" ) addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) triggerServerEvent ( "SetMessage", localPlayer ) end ) يليت ترد بسرعه Link to comment
!#NssoR_) Posted October 7, 2016 Share Posted October 7, 2016 -- * Edited By 3MEED local x,y = guiGetScreenSize(); addEvent ( "3MEED", true ) addEventHandler ( "3MEED", getRootElement(),function(message) txt = message; playSoundFrontEnd ( 49 ) end) addEventHandler("onClientRender", getRootElement( ),function( ) if ( txt ) then dxDrawText ( "#FF0000Admin :", x*(13.0/800), y*(167.0/600), x*(55.0/800), y*(182.0/600), tocolor ( 255, 255, 0, 255 ), 1.0, "default-bold", "left", "top", false, false, false ,true) dxDrawText (txt, x*(60.0/800), y*(168.0/600), x*(799.0/800), y*(224.0/600), tocolor ( 255, 255, 255, 255 ), 1.0, "default-bold", "left", "top", false, false, false ,true) end if ( getElementData(resourceRoot,"PlrAdmin") ) then dxDrawText("#ffffff "..getElementData(resourceRoot,"PlrAdmin"),x*(13.0/800),y*(184.0/600),x*(799.0/800),y*(224.0/600),tocolor(255,255,255,255),1.3,"default-bold","left","top",false,false,false,true) end end) bindKey ( "i", "down", "chatbox", "Admin" ) addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) triggerServerEvent ( "SetMessage", localPlayer ) end ) Link to comment
twitter Posted October 7, 2016 Author Share Posted October 7, 2016 شكرآ طيب لاهنت ابغى العاجل على السيريال + اكتب كلمه باف8 تشيله 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