Mr Trial Posted February 4, 2024 Share Posted February 4, 2024 سلام عليكم عندي مشكله لما اشغل مود التاجات للرتب يصير تكرار كلام بالشات زي الصورة مع اني مطفي مود play وال freeroam ولكن فيه كلام بالشات يظهر اضافي مع التاج كيف اشيله؟ local root = getRootElement() addEventHandler('onPlayerChat',root, function ( text ) name = getPlayerName ( source ) account = getAccountName ( getPlayerAccount ( source ) ) if ( getPlayerTeam ( source ) ) then local r,g,b = getTeamColor ( getPlayerTeam ( source ) ) cancelEvent ( ) outputChatBox(''..getPlayerName(source)..': #FFFFFF'..text..'',root,r,g,b,true) else cancelEvent() if isObjectInACLGroup("user." .. account, aclGetGroup("Console")) then outputChatBox("#FF8C00[Console]#FFFFFF" .. name .. ":#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("console")) then outputChatBox("#FF0000[Admin]" .. name .. ":#FFFFFF " .. text, root, 255, 255, 255, true) end end end) صورة للشات للتوضيح : https://imgur.com/b1uSZsM Link to comment
Scripting Moderators xLive Posted February 6, 2024 Scripting Moderators Share Posted February 6, 2024 playercolors أعتقد سكربت بعد onPlayerChat يستخدم 1 Link to comment
O7X Posted April 4, 2024 Share Posted April 4, 2024 (edited) المشكله عندك انك تلغي الحدث يدوي فبالتالي راح يعالج الحدث مرتين مره من الاسكربت تبعك و مره من واسطه الاليه المعالجه علشان تحل المشكله لازم معالجه الحدث مره واحده بس وذا الكود بعد التصحيح local root = getRootElement() addEventHandler( "onPlayerChat", root, function(text) name = getPlayerName(source) account = getAccountName(getPlayerAccount(source)) if (getPlayerTeam(source)) then local r, g, b = getTeamColor(getPlayerTeam(source)) cancelEvent() outputChatBox("" .. name .. ": #FFFFFF" .. text .. "", root, r, g, b, true) else cancelEvent() if isObjectInACLGroup("user." .. account, aclGetGroup("Console")) then outputChatBox("#FF8C00[Console]#FFFFFF " .. name .. ":#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("console")) then outputChatBox("#FF0000[Admin] " .. name .. ":#FFFFFF " .. text, root, 255, 255, 255, true) end end end ) By:O7X Edited April 4, 2024 by O7X Edit on Code 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