Jump to content

طلب تعديل كود


XPro

Recommended Posts

local root = getRootElement() 
  
function chatbox(text, msgtype) 
    local account = getAccountName(getPlayerAccount(source)) 
        local name = getPlayerName(source) 
        local playercolor = getPlayerNametagColor ( name ) 
 cancelEvent() 
    if isObjectInACLGroup("user." .. account, aclGetGroup("Moderator")) then 
        outputChatBox("#00FFFF ~| > Mode <|~  " .. name .. ":#bbbbbb " .. text, root, 255, 255, 255, true) 
elseif isObjectInACLGroup("user." .. account, aclGetGroup("SuperModerator")) then  
         outputChatBox("#00FFFF ~| > SuperMode <|~  " .. name ..":#0000FF " .. text, root, 255, 255, 255, true)  
        
    elseif isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) then 
        outputChatBox("#00FFFF ~| > Admin <|~  ".. getPlayerNametagColor .." " .. name .. ":#00CCFF " .. text, root, 255, 255, 255, true) 
   
 elseif isObjectInACLGroup("user." .. account, aclGetGroup("Console")) then 
        outputChatBox("#00FFFF ~| > Console <|~  #FFFFFF#ff0000*" .. name .. ":#FFFF00 " .. text, root, 255, 255, 255, true) 
    
 elseif isObjectInACLGroup("user." .. account, aclGetGroup("BestPlayer")) then 
        outputChatBox("#00FFFF ~| > Best-Player <|~  #FFFFFF#ff0000*" .. name .. ":#00FF00 " .. text, root, 255, 255, 255, true) 
  
end 
end 
addEventHandler("onPlayerChat", root, chatbox)   
  

كيف اخليه يجيب لون اللاعب و يحطه بدون ما احدد انا

او اخلي السطر 6 سورس و اطبق زي السطر 14 مثال على التصحيح

انا جربت كذا اطلب تصحيح

Link to comment
local root = getRootElement() 
  
function chatbox(text, msgtype) 
    local account = getAccountName(getPlayerAccount(source)) 
        local name = getPlayerName(source) 
        local playercolor = getPlayerNametagColor ( name ) 
 cancelEvent() 
    if isObjectInACLGroup("user." .. account, aclGetGroup("Moderator")) then 
        outputChatBox("#00FFFF ~| > Mode <|~  " .. name .. ":#bbbbbb " .. text, root, 255, 255, 255, true) 
elseif isObjectInACLGroup("user." .. account, aclGetGroup("SuperModerator")) then  
         outputChatBox("#00FFFF ~| > SuperMode <|~  " .. name ..":#0000FF " .. text, root, 255, 255, 255, true)  
        
    elseif isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) then 
        outputChatBox("#00FFFF ~| > Admin <|~  ".. getPlayerNametagColor .." " .. name .. ":#00CCFF " .. text, root, 255, 255, 255, true) 
   
 elseif isObjectInACLGroup("user." .. account, aclGetGroup("Console")) then 
        outputChatBox("#00FFFF ~| > Console <|~  #FFFFFF#ff0000*" .. name .. ":#FFFF00 " .. text, root, 255, 255, 255, true) 
    
 elseif isObjectInACLGroup("user." .. account, aclGetGroup("BestPlayer")) then 
        outputChatBox("#00FFFF ~| > Best-Player <|~  #FFFFFF#ff0000*" .. name .. ":#00FF00 " .. text, root, 255, 255, 255, true) 
  
end 
end 
addEventHandler("onPlayerChat", root, chatbox)   
  

كيف اخليه يجيب لون اللاعب و يحطه بدون ما احدد انا

او اخلي السطر 6 سورس و اطبق زي السطر 14 مثال على التصحيح

انا جربت كذا اطلب تصحيح

تفضل لم يتم التجربة :

local root = getRootElement() 
  
function chatbox(text, msgtype) 
    local account = getAccountName(getPlayerAccount(source)) 
        local name = getPlayerName(source) 
        local playercolor = getPlayerNametagColor (getLocalPlayer()) 
 cancelEvent() 
    if isObjectInACLGroup("user." .. account, aclGetGroup("Moderator")) then 
        outputChatBox("#00FFFF ~| > Mode <|~  " .. playercolor .. " " .. name .. ":#bbbbbb " .. text, root, 255, 255, 255, true) 
elseif isObjectInACLGroup("user." .. account, aclGetGroup("SuperModerator")) then 
         outputChatBox("#00FFFF ~| > SuperMode <|~  "  .. playercolor .. " " .. name ..":#0000FF " .. text, root, 255, 255, 255, true) 
        
    elseif isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) then 
        outputChatBox("#00FFFF ~| > Admin <|~  "  .. playercolor .. " " .. name .. ":#00CCFF " .. text, root, 255, 255, 255, true) 
  
 elseif isObjectInACLGroup("user." .. account, aclGetGroup("Console")) then 
        outputChatBox("#00FFFF ~| > Console <|~  #FFFFFF#ff0000*" .. playercolor .. " " .. name .. ":#FFFF00 " .. text, root, 255, 255, 255, true) 
    
 elseif isObjectInACLGroup("user." .. account, aclGetGroup("BestPlayer")) then 
        outputChatBox("#00FFFF ~| > Best-Player <|~  #FFFFFF#ff0000*" .. playercolor .." " .. name .. ":#00FF00 " .. text, root, 255, 255, 255, true) 
  
end 
end 
addEventHandler("onPlayerChat", root, chatbox)  
  

Link to comment
local root = getRootElement() 
  
function chatbox(text, msgtype) 
    local account = getAccountName(getPlayerAccount(source)) 
        local name = getPlayerName(source) 
        local playercolor = getPlayerNametagColor ( name ) 
 cancelEvent() 
    if isObjectInACLGroup("user." .. account, aclGetGroup("Moderator")) then 
        outputChatBox("#00FFFF ~| > Mode <|~  " .. name .. ":#bbbbbb " .. text, root, 255, 255, 255, true) 
elseif isObjectInACLGroup("user." .. account, aclGetGroup("SuperModerator")) then  
         outputChatBox("#00FFFF ~| > SuperMode <|~  " .. name ..":#0000FF " .. text, root, 255, 255, 255, true)  
        
    elseif isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) then 
        outputChatBox("#00FFFF ~| > Admin <|~  ".. getPlayerNametagColor .." " .. name .. ":#00CCFF " .. text, root, 255, 255, 255, true) 
   
 elseif isObjectInACLGroup("user." .. account, aclGetGroup("Console")) then 
        outputChatBox("#00FFFF ~| > Console <|~  #FFFFFF#ff0000*" .. name .. ":#FFFF00 " .. text, root, 255, 255, 255, true) 
    
 elseif isObjectInACLGroup("user." .. account, aclGetGroup("BestPlayer")) then 
        outputChatBox("#00FFFF ~| > Best-Player <|~  #FFFFFF#ff0000*" .. name .. ":#00FF00 " .. text, root, 255, 255, 255, true) 
  
end 
end 
addEventHandler("onPlayerChat", root, chatbox)   
  

كيف اخليه يجيب لون اللاعب و يحطه بدون ما احدد انا

او اخلي السطر 6 سورس و اطبق زي السطر 14 مثال على التصحيح

انا جربت كذا اطلب تصحيح

تفضل لم يتم التجربة :

local root = getRootElement() 
  
function chatbox(text, msgtype) 
    local account = getAccountName(getPlayerAccount(source)) 
        local name = getPlayerName(source) 
        local playercolor = getPlayerNametagColor (getLocalPlayer()) 
 cancelEvent() 
    if isObjectInACLGroup("user." .. account, aclGetGroup("Moderator")) then 
        outputChatBox("#00FFFF ~| > Mode <|~  " .. playercolor .. " " .. name .. ":#bbbbbb " .. text, root, 255, 255, 255, true) 
elseif isObjectInACLGroup("user." .. account, aclGetGroup("SuperModerator")) then 
         outputChatBox("#00FFFF ~| > SuperMode <|~  "  .. playercolor .. " " .. name ..":#0000FF " .. text, root, 255, 255, 255, true) 
        
    elseif isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) then 
        outputChatBox("#00FFFF ~| > Admin <|~  "  .. playercolor .. " " .. name .. ":#00CCFF " .. text, root, 255, 255, 255, true) 
  
 elseif isObjectInACLGroup("user." .. account, aclGetGroup("Console")) then 
        outputChatBox("#00FFFF ~| > Console <|~  #FFFFFF#ff0000*" .. playercolor .. " " .. name .. ":#FFFF00 " .. text, root, 255, 255, 255, true) 
    
 elseif isObjectInACLGroup("user." .. account, aclGetGroup("BestPlayer")) then 
        outputChatBox("#00FFFF ~| > Best-Player <|~  #FFFFFF#ff0000*" .. playercolor .." " .. name .. ":#00FF00 " .. text, root, 255, 255, 255, true) 
  
end 
end 
addEventHandler("onPlayerChat", root, chatbox)  
  

لوكال بلاير سيرفر سايد ؟ :|

Link to comment
local root = getRootElement() 
  
function chatbox(text, msgtype) 
local account = getAccountName(getPlayerAccount(source)) 
local name = getPlayerName(source) 
local playercolor = getPlayerNametagColor (source) 
cancelEvent() 
    if     isObjectInACLGroup("user." .. account, aclGetGroup("Moderator")) then 
           outputChatBox("#00FFFF ~| > Mode <|~  " .. playercolor .. " " .. name .. ":#bbbbbb " .. text, root, 255, 255, 255, true) 
    elseif isObjectInACLGroup("user." .. account, aclGetGroup("SuperModerator")) then 
           outputChatBox("#00FFFF ~| > SuperMode <|~  "  .. playercolor .. " " .. name ..":#0000FF " .. text, root, 255, 255, 255, true) 
        
    elseif isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) then 
           outputChatBox("#00FFFF ~| > Admin <|~  "  .. playercolor .. " " .. name .. ":#00CCFF " .. text, root, 255, 255, 255, true) 
  
    elseif isObjectInACLGroup("user." .. account, aclGetGroup("Console")) then 
           outputChatBox("#00FFFF ~| > Console <|~  #FFFFFF#ff0000*" .. playercolor .. " " .. name .. ":#FFFF00 " .. text, root, 255, 255, 255, true) 
    
    elseif isObjectInACLGroup("user." .. account, aclGetGroup("BestPlayer")) then 
           outputChatBox("#00FFFF ~| > Best-Player <|~  #FFFFFF#ff0000*" .. playercolor .." " .. name .. ":#00FF00 " .. text, root, 255, 255, 255, true) 
  
end 
end 
addEventHandler("onPlayerChat", root, chatbox) 
  

Link to comment

مشكلة في كود انو يعطيني ارقام لون الاسم بس ما يلون الاسم يعني كذا

الشعار ملون ازرق

بعد الشعار يجي ارقام الي هم كود لون الاسم

الاسم

و كل شي ازرق انا الحين ابي الشعار بس ازرق اما اسم لونه عادي مو انا احدده

ارجو التصحيح

Link to comment
مشكلة في كود انو يعطيني ارقام لون الاسم بس ما يلون الاسم يعني كذا

الشعار ملون ازرق

بعد الشعار يجي ارقام الي هم كود لون الاسم

الاسم

و كل شي ازرق انا الحين ابي الشعار بس ازرق اما اسم لونه عادي مو انا احدده

ارجو التصحيح

شغل مود playerscolor

اتوقع اسمه كذا

Link to comment
  • Moderators

تفصل اخوي ..

#غير مجرب

function RGBToHex (red, green, blue, alpha) 
    if((red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255) or (alpha and (alpha < 0 or alpha > 255))) then 
        return nil 
    end 
    if(alpha) then 
        return string.format("#%.2X%.2X%.2X%.2X", red,green,blue,alpha) 
    else 
        return string.format("#%.2X%.2X%.2X", red,green,blue) 
    end 
end 
  
local root = getRootElement() 
  
function chatbox(text, msgtype) 
local account = getAccountName(getPlayerAccount(source)) 
local name = getPlayerName(source) 
local r, g, b = getPlayerNametagColor (source) 
local playercolor = RGBToHex ( r, g, b ) 
cancelEvent() 
    if     isObjectInACLGroup("user." .. account, aclGetGroup("Moderator")) then 
           outputChatBox("#00FFFF ~| > Mode <|~  " .. playercolor .. " " .. name .. ":#bbbbbb " .. text, root, 255, 255, 255, true) 
    elseif isObjectInACLGroup("user." .. account, aclGetGroup("SuperModerator")) then 
           outputChatBox("#00FFFF ~| > SuperMode <|~  "  .. playercolor .. " " .. name ..":#0000FF " .. text, root, 255, 255, 255, true) 
        
    elseif isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) then 
           outputChatBox("#00FFFF ~| > Admin <|~  "  .. playercolor .. " " .. name .. ":#00CCFF " .. text, root, 255, 255, 255, true) 
  
    elseif isObjectInACLGroup("user." .. account, aclGetGroup("Console")) then 
           outputChatBox("#00FFFF ~| > Console <|~  #FFFFFF#ff0000*" .. playercolor .. " " .. name .. ":#FFFF00 " .. text, root, 255, 255, 255, true) 
    
    elseif isObjectInACLGroup("user." .. account, aclGetGroup("BestPlayer")) then 
           outputChatBox("#00FFFF ~| > Best-Player <|~  #FFFFFF#ff0000*" .. playercolor .." " .. name .. ":#00FF00 " .. text, root, 255, 255, 255, true) 
  
end 
end 
addEventHandler("onPlayerChat", root, chatbox) 
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...