Jump to content

TagColor


Mr-M3AND

Recommended Posts

السلام عليكم

لاهنتو شباب هذا كود القريد ليست اسماء اللاعبين ابي الون اسماء اللاعبين نفس لون تاج الادمنية الخاص بكل لاعب بس مايطلع معي الا لون التاج الاصلي للعبه مع

.. هل من حل , player colors و freeroam اني قفلت ال

Wnd = {} 
  button = {} 
  GridList = {} 
  
Wnd[1] = guiCreateWindow(461,188,162,280,"",false) 
GridList[1] = guiCreateGridList(0.0556,0.075,0.8889,0.7429,true,Wnd[1]) 
guiGridListSetSelectionMode(GridList[1],2) 
guiGridListAddColumn(GridList[1],"player name",0.-- s8) -->
button[1] = guiCreateButton(0.0617,0.8393,0.8827,0.1286,"get",true,Wnd[1]) 
   local row = guiGridListAddRow ( GridList[1] ) 
   for i, v in ipairs(getElementsByType("player")) do 
       guiGridListSetItemText ( GridList[1], row, column, getPlayerName ( v ), false, false ) 
   local r, g, b = getPlayerNametagColor(localPlayer) 
       guiGridListSetItemColor (  GridList[1], row , column,  r, g, b ) 
   end 

Link to comment

جرب #

Wnd = {} 
button = {} 
GridList = {} 
      
Wnd[1] = guiCreateWindow(461,188,162,280,"",false) 
GridList[1] = guiCreateGridList(0.0556,0.075,0.8889,0.7429,true,Wnd[1]) 
guiGridListSetSelectionMode(GridList[1],2) 
guiGridListAddColumn(GridList[1],"player name",0.8  ) 
button[1] = guiCreateButton(0.0617,0.8393,0.8827,0.1286,"get",true,Wnd[1]) 
local row = guiGridListAddRow ( GridList[1] ) 
    for i, v in ipairs(getElementsByType("player")) do 
        guiGridListSetItemText ( GridList[1], row, column, getPlayerName ( v ), false, false ) 
        local r, g, b = getPlayerNametagColor(v) 
        guiGridListSetItemColor (  GridList[1], row , column,  r, g, b ) 
    end 

Link to comment
جرب #
Wnd = {} 
button = {} 
GridList = {} 
      
Wnd[1] = guiCreateWindow(461,188,162,280,"",false) 
GridList[1] = guiCreateGridList(0.0556,0.075,0.8889,0.7429,true,Wnd[1]) 
guiGridListSetSelectionMode(GridList[1],2) 
guiGridListAddColumn(GridList[1],"player name",0.8  ) 
button[1] = guiCreateButton(0.0617,0.8393,0.8827,0.1286,"get",true,Wnd[1]) 
local row = guiGridListAddRow ( GridList[1] ) 
    for i, v in ipairs(getElementsByType("player")) do 
        guiGridListSetItemText ( GridList[1], row, column, getPlayerName ( v ), false, false ) 
        local r, g, b = getPlayerNametagColor(v) 
        guiGridListSetItemColor (  GridList[1], row , column,  r, g, b ) 
    end 

ماتغير شي

Link to comment
يبي * . اسم الاعب في القريد ليست على لون تاجة فهمت
لاهنتو شباب هذا كود القريد ليست اسماء اللاعبين ابي الون اسماء اللاعبين نفس لون تاج الادمنية الخاص بكل لاعب بس مايطلع معي الا لون التاج الاصلي للعبه مع

.. هل من حل , player colors و freeroam اني قفلت ال

Link to comment
مالها دخل , لأن الي فهمته انك تبي مثل لون التاج , يعني مثل لون التاج بالشات getPlayerNametagColor الوظيفه

الافضل انك تسوي داتا مع التاج.

قصدك اعدل على مود التاج واسوي له داتا ؟؟

Link to comment
اظن بتكون فيه مشاكل لو كنت حاط اكواد هيكس,

كيف ما ضبطت معك؟ getPlayerNametagColor تأكد من

الي اعرفه ان الوظيفه تجيب لون النك حق اللاعب , وهذا يعني انها بتضبط ذذ

صحيح المفروض يجيب لون النك لكن الشي الغريب اني ركبت كذا تاج ومايطلع الا لون اللاعب اللي يجي بالتاب مع اني طفيت الفري روم وبلير كولور يبقى اللون موجود

Link to comment

خخخخخخخخخخخ انت شكلك فاهم الكود غلط

هذا الكود getPlayerNametagColor

هذا يجيب لون النك ولكن مو النك الي بشات النك الي علي الاعب نفسه مو نك الاعب الي بشات

!! طيب ليش ماقلت كذا من البداية ؟؟ كان كلامي واضح فوق قلت ابي لون اللاعب نفس لون تاج الادمنية

Link to comment

شوف هالمثال على كودك وتاج باسم الحساب :

Client Side :

Wnd = {} 
button = {} 
GridList = {} 
  
  
      
function hexToRGB ( hex ) 
        hex = hex:gsub("#","") 
        return tonumber("0x"..hex:sub(1,2)), tonumber("0x"..hex:sub(3,4)), tonumber("0x"..hex:sub(5,6)) 
end 
      
Wnd[1] = guiCreateWindow(461,188,162,280,"",false) 
GridList[1] = guiCreateGridList(0.0556,0.075,0.8889,0.7429,true,Wnd[1]) 
guiGridListSetSelectionMode(GridList[1],2) 
guiGridListAddColumn(GridList[1],"player name",0.8  ) 
button[1] = guiCreateButton(0.0617,0.8393,0.8827,0.1286,"get",true,Wnd[1]) 
  
local row = guiGridListAddRow ( GridList[1] ) 
    for i, v in ipairs(getElementsByType("player")) do 
        guiGridListSetItemText ( GridList[1], row, 1, getPlayerName ( v ), false, false ) 
        local aHex = getElementData ( v,'TAGHexColor' ) 
        local r,g,b = hexToRGB ( aHex ) 
        guiGridListSetItemColor (  GridList[1], row , 1,  r, g, b ) 
    end 

Server Side :

addEventHandler ( 'onPlayerChat',root, 
    function ( msg ) 
        if not isGuestAccount ( getPlayerAccount ( source ) ) and getAccountName ( getPlayerAccount ( source ) ) == 'اسم الحسـاب' then 
            cancelEvent (       ) 
            Color = '#00ff00' 
        setElementData ( source,'TAGHexColor',Color ) 
            outputChatBox ( ' '..Color..' [ M3AND ] : '..msg,root,255,255,255,true ) 
        end 
    end  
) 

طبعاً انت عين الداتا اذا سجل دخولة بالحساب عشان تفادياً للاق لكن هذا مثال وترا الداتا تتخزن كل مايتكلم اللاعب!

Link to comment

خخخخخخخخخخخ انت شكلك فاهم الكود غلط

هذا الكود getPlayerNametagColor

هذا يجيب لون النك ولكن مو النك الي بشات النك الي علي الاعب نفسه مو نك الاعب الي بشات

outputChatBox + getPlayerNametagColor فاهم الكود انا بس حسبته حاط لون التاج بالشات على لون تاج اللاعب بإستخدام

Link to comment
شوف هالمثال على كودك وتاج باسم الحساب :

Client Side :

Wnd = {} 
button = {} 
GridList = {} 
  
  
      
function hexToRGB ( hex ) 
        hex = hex:gsub("#","") 
        return tonumber("0x"..hex:sub(1,2)), tonumber("0x"..hex:sub(3,4)), tonumber("0x"..hex:sub(5,6)) 
end 
      
Wnd[1] = guiCreateWindow(461,188,162,280,"",false) 
GridList[1] = guiCreateGridList(0.0556,0.075,0.8889,0.7429,true,Wnd[1]) 
guiGridListSetSelectionMode(GridList[1],2) 
guiGridListAddColumn(GridList[1],"player name",0.8  ) 
button[1] = guiCreateButton(0.0617,0.8393,0.8827,0.1286,"get",true,Wnd[1]) 
  
local row = guiGridListAddRow ( GridList[1] ) 
    for i, v in ipairs(getElementsByType("player")) do 
        guiGridListSetItemText ( GridList[1], row, 1, getPlayerName ( v ), false, false ) 
        local aHex = getElementData ( v,'TAGHexColor' ) 
        local r,g,b = hexToRGB ( aHex ) 
        guiGridListSetItemColor (  GridList[1], row , 1,  r, g, b ) 
    end 

Server Side :

addEventHandler ( 'onPlayerChat',root, 
    function ( msg ) 
        if not isGuestAccount ( getPlayerAccount ( source ) ) and getAccountName ( getPlayerAccount ( source ) ) == 'اسم الحسـاب' then 
            cancelEvent (       ) 
            Color = '#00ff00' 
        setElementData ( source,'TAGHexColor',Color ) 
            outputChatBox ( ' '..Color..' [ M3AND ] : '..msg,root,255,255,255,true ) 
        end 
    end  
) 

طبعاً انت عين الداتا اذا سجل دخولة بالحساب عشان تفادياً للاق لكن هذا مثال وترا الداتا تتخزن كل مايتكلم اللاعب!

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

Wnd = {} 
button = {} 
GridList = {} 
      
Wnd[1] = guiCreateWindow(461,188,162,280,"",false) 
GridList[1] = guiCreateGridList(0.0556,0.075,0.8889,0.7429,true,Wnd[1]) 
guiGridListSetSelectionMode(GridList[1],2) 
guiGridListAddColumn(GridList[1],"player name",0.8  ) 
button[1] = guiCreateButton(0.0617,0.8393,0.8827,0.1286,"get",true,Wnd[1]) 
local row = guiGridListAddRow ( GridList[1] ) 
    for i, v in ipairs(getElementsByType("player")) do 
        guiGridListSetItemText ( GridList[1], row, column, getPlayerName ( v ), false, false ) 
        guiGridListSetItemColor (  GridList[1], row , column,  0, 0, 255 ) 
    end 
  

Link to comment

تفضل جرب الكود :

Server Side :

aGroupsColors = {        
      -- { 'Group Name',r,g,b }, 
        { 'Console', 255,0,0 }, 
        { 'Admin',0,255,0 }, 
    } 
     
     
addEventHandler ( 'onPlayerLogin',root, 
    function (   _,account  ) 
     local accName = getAccountName ( account ) 
      for k,v in ipairs ( aGroupsColors ) do  
        for i =1,#aGroupsColors do 
          if isObjectInACLGroup ("user."..accName, aclGetGroup ( aGroupsColors [i][1] ) ) then 
                setElementData ( source,'aRListColor',aGroupsColors [i][2] ) 
                setElementData ( source,'aGListColor',aGroupsColors [i][3] ) 
                setElementData ( source,'aBListColor',aGroupsColors [i][4] ) 
            end 
        end 
    end 
end ) 

Client Side :

Wnd = {} 
button = {} 
GridList = {} 
      
Wnd[1] = guiCreateWindow(461,188,162,280,"",false) 
GridList[1] = guiCreateGridList(0.0556,0.075,0.8889,0.7429,true,Wnd[1]) 
guiGridListSetSelectionMode(GridList[1],2) 
guiGridListAddColumn(GridList[1],"player name",0.8  ) 
button[1] = guiCreateButton(0.0617,0.8393,0.8827,0.1286,"get",true,Wnd[1]) 
local row = guiGridListAddRow ( GridList[1] ) 
    for i, v in ipairs(getElementsByType("player")) do 
        guiGridListSetItemText ( GridList[1], row, 1, getPlayerName ( v ), false, false ) 
        local aR = getElementData ( localPlayer,'aRListColor' ) 
        local aG = getElementData ( localPlayer,'aGListColor' ) 
        local aB = getElementData ( localPlayer,'aBListColor' ) 
    if aR and aG and aB then 
            guiGridListSetItemColor (  GridList[1], row , 1,aR,aG,aB  ) 
    end 
end 

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...