*[MSN]MHMD Posted April 15, 2015 Share Posted April 15, 2015 مشكور ترا كتبت له اول شي بدون هذا التحقق لكنه قلي م ضبط حسبت المشكلة من التعريف على كل حال المفروض الكود يشتغل مع وبدون تحقق الاعب هذا بس الزبدة صاحب الموضوع يقول الكود م يبي يشتغل اظن المشكلة كيف قلت انت انه مسوي تاج للرتبة فهو يكنسل الايفنت بذاك الوقت مشكور يعطيك العافية Link to comment
; Mr.T76eM # Posted April 15, 2015 Author Share Posted April 15, 2015 اها بارك الله فيكم تراني شايف الكود صحيح بعد لكن مدري ليه ما يشتغل الزبده وش اسوي مع التاجات ؟ يعني المشكلة من التاجات ؟ Link to comment
; Mr.T76eM # Posted April 15, 2015 Author Share Posted April 15, 2015 هذا هو التاج حقي ..# local root = getRootElement() function chatbox(text, msgtype) local account = getAccountName(getPlayerAccount(source)) local name = getPlayerName(source) cancelEvent() if isObjectInACLGroup("user." .. account, aclGetGroup("Console")) then outputChatBox("#ffffff* #000000[#ff0000 Console#000000 ] " .. name .. ":#ffcc00 " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) then outputChatBox("#ffffff* #000000[#D80000 Head Admin #000000] #FFFFFF#ff0000" .. name .. ":#E8A317 " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("SuperModerator")) then outputChatBox("#7D1B7E°•~█|ṩὗῥἔʀмὄḋἔʀᾄҭὄʀ.Pro.|█~•°#FFFFFF#ff0000" .. name ..":#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Moderator")) then outputChatBox("#F778A1°•~█|мὄḋἔʀᾄҭὄʀῥʀὄ|█~•°#FFFFFF#ff0000" .. name .. ":#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("VIP")) then outputChatBox(" #000000[#ffffff+#ff9900Rent#000000 ]#ff9900 " .. name .. ":#33CCFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Police")) then outputChatBox("#ffffff* [ #0099FFPØlice #ffffff]" .. name .. ":#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Everyone")) then outputChatBox("#ffffff~|PLAYER|°#ffffff#ff0000" .. name .. ":#ffffff " .. text, root, 255, 255, 255, true) end end addEventHandler("onPlayerChat", root, chatbox) Link to comment
TAPL Posted April 15, 2015 Share Posted April 15, 2015 مافيه بارتمار لاعب اصلاً onPlayerChat الأفنت السورس هو اللاعب الي كتب في الشات .__." + لازم تدمج الكود مع التاج ولا رح يطلع الكلام بالشات ما رح يتكنسل Link to comment
; Mr.T76eM # Posted April 15, 2015 Author Share Posted April 15, 2015 زي كذا يعني ؟ local root = getRootElement() function chatbox(text, msgtype) local account = getAccountName(getPlayerAccount(source)) local name = getPlayerName(source) cancelEvent() if isObjectInACLGroup("user." .. account, aclGetGroup("Console")) then outputChatBox("#ffffff* #000000[#ff0000 Console#000000 ] " .. name .. ":#ffcc00 " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) then outputChatBox("#ffffff* #000000[#D80000 Head Admin #000000] #FFFFFF#ff0000" .. name .. ":#E8A317 " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("SuperModerator")) then outputChatBox("#7D1B7E°•~█|ṩὗῥἔʀмὄḋἔʀᾄҭὄʀ.Pro.|█~•°#FFFFFF#ff0000" .. name ..":#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Moderator")) then outputChatBox("#F778A1°•~█|мὄḋἔʀᾄҭὄʀῥʀὄ|█~•°#FFFFFF#ff0000" .. name .. ":#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("VIP")) then outputChatBox(" #000000[#ffffff+#ff9900Rent#000000 ]#ff9900 " .. name .. ":#33CCFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Police")) then outputChatBox("#ffffff* [ #0099FFPØlice #ffffff]" .. name .. ":#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Everyone")) then outputChatBox("#ffffff~|PLAYER|°#ffffff#ff0000" .. name .. ":#ffffff " .. text, root, 255, 255, 255, true) else if ( string.find(text,"شت") ) then cancelEvent() outputChatBox(" Mmno3 alsb ",text,255,0,0,true) end end end addEventHandler("onPlayerChat", root, chatbox) Link to comment
TAPL Posted April 15, 2015 Share Posted April 15, 2015 function chatbox(text) cancelEvent() if string.find(text, "شت") then outputChatBox("Mmno3 alsb", source, 255, 0, 0, true) return end local account = getAccountName(getPlayerAccount(source)) local name = getPlayerName(source) if isObjectInACLGroup("user."..account, aclGetGroup("Console")) then outputChatBox("#ffffff* #000000[#ff0000 Console#000000 ] "..name..":#ffcc00 "..text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user."..account, aclGetGroup("Admin")) then outputChatBox("#ffffff* #000000[#D80000 Head Admin #000000] #FFFFFF#ff0000"..name..":#E8A317 "..text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user."..account, aclGetGroup("SuperModerator")) then outputChatBox("#7D1B7E°•~█|ṩὗῥἔʀмὄḋἔʀᾄҭὄʀ.Pro.|█~•°#FFFFFF#ff0000"..name..":#FFFFFF "..text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user."..account, aclGetGroup("Moderator")) then outputChatBox("#F778A1°•~█|мὄḋἔʀᾄҭὄʀῥʀὄ|█~•°#FFFFFF#ff0000"..name..":#FFFFFF "..text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user."..account, aclGetGroup("VIP")) then outputChatBox(" #000000[#ffffff+#ff9900Rent#000000 ]#ff9900 "..name..":#33CCFF "..text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user."..account, aclGetGroup("Police")) then outputChatBox("#ffffff* [ #0099FFPØlice #ffffff]"..name..":#FFFFFF "..text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user."..account, aclGetGroup("Everyone")) then outputChatBox("#ffffff~|PLAYER|°#ffffff#ff0000"..name..":#ffffff "..text, root, 255, 255, 255, true) end end addEventHandler("onPlayerChat", root, chatbox) Link to comment
; Mr.T76eM # Posted April 15, 2015 Author Share Posted April 15, 2015 function chatbox(text) cancelEvent() if string.find(text, "شت") then outputChatBox("Mmno3 alsb", source, 255, 0, 0, true) return end local account = getAccountName(getPlayerAccount(source)) local name = getPlayerName(source) if isObjectInACLGroup("user."..account, aclGetGroup("Console")) then outputChatBox("#ffffff* #000000[#ff0000 Console#000000 ] "..name..":#ffcc00 "..text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user."..account, aclGetGroup("Admin")) then outputChatBox("#ffffff* #000000[#D80000 Head Admin #000000] #FFFFFF#ff0000"..name..":#E8A317 "..text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user."..account, aclGetGroup("SuperModerator")) then outputChatBox("#7D1B7E°•~█|ṩὗῥἔʀмὄḋἔʀᾄҭὄʀ.Pro.|█~•°#FFFFFF#ff0000"..name..":#FFFFFF "..text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user."..account, aclGetGroup("Moderator")) then outputChatBox("#F778A1°•~█|мὄḋἔʀᾄҭὄʀῥʀὄ|█~•°#FFFFFF#ff0000"..name..":#FFFFFF "..text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user."..account, aclGetGroup("VIP")) then outputChatBox(" #000000[#ffffff+#ff9900Rent#000000 ]#ff9900 "..name..":#33CCFF "..text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user."..account, aclGetGroup("Police")) then outputChatBox("#ffffff* [ #0099FFPØlice #ffffff]"..name..":#FFFFFF "..text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user."..account, aclGetGroup("Everyone")) then outputChatBox("#ffffff~|PLAYER|°#ffffff#ff0000"..name..":#ffffff "..text, root, 255, 255, 255, true) end end addEventHandler("onPlayerChat", root, chatbox) اشتغل المود # تمت الافادة # بآرك الله فيك تابل على المجهود # مشكور محمد على المجهود بارك الله فيكم جميعا ويجعله من ميزان حسناتكم يارب .. ممكن سؤال اخير ؟ ض3 return end هذي الوظيفه وش فايدتها ممكن شرح بسيط ؟ Link to comment
ALw7sH Posted April 16, 2015 Share Posted April 16, 2015 return لو حطيت خلاص السكربت مابيواصل قراءة الفنكشن -- من هنا وتحت مابيفيدك الا لو تبي تصنع فنكشن -- مثلاً return ولو حطيت قيمة بعد ال function test() return true end واستخدمت الفنكشن nvm = test() print(tostring(nvm)) true القيمة الي بيرجعها الفنكشن هي Link to comment
*[MSN]MHMD Posted April 16, 2015 Share Posted April 16, 2015 حياك الله اخوي احنا دايمن بخدمتك 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