Jump to content

لوحة ليبل -- مساعدة


Recommended Posts

هذا كود من الاخ Booo

بسم الله الرحمن الرحيم

وظيفه تقوم بجلب جميع القروبات للاعب

* لازم يكون مسجل دخول بحسابه

فقط سيرفر

صيغة الوظيفه

getPlayerAllGroups(player) 

الكود

  
function getPlayerAllGroups(player) 
    local account = getPlayerAccount ( player) 
    if ( isGuestAccount ( account ) ) then 
        return false 
    end 
                  local  AclList = {} 
                                  AclList["Groups"] = {} 
                  AclList["getGroups"] = {} 
        for _, group in ipairs ( aclGroupList() ) do 
                table.insert ( AclList["Groups"],aclGroupGetName ( group ) ) 
        end 
        for k ,v in pairs(AclList.Groups) do 
            if isObjectInACLGroup ( "user."..getAccountName ( account ), aclGetGroup (v) )then 
                table.insert ( AclList["getGroups"],v) 
            end 
        end 
        return table.concat(AclList.getGroups, ",") 
end 

مثآل

مثآل من عناد

الله يعطيه العآفيه

  
addCommandHandler ( "mygroups", function ( p ) 
    local groups = getPlayerAllGroups ( p ) 
    if groups then 
        outputChatBox ( getPlayerName ( p ).. " [ "..groups.." ].", root, 255, 255, 0, true ) 
    end 
end ) 
  

https://wiki.multitheftauto.com/wiki/GetPlayerAllGroups

جيبهم واستخدم

triggerClientEvent 
guiSetText 

Link to comment

مافهمت زين من الردود

لكن عدلت شوي كذا صح

s

addEventHandler ( "onPlayerLogin", root, 
    function ( _, acl ) 
        local Account = aclGetName ( acl ) 
       setElementData(source,"acl",Accoun) 
    end 
) 
  
addEventHandler("onElementDataChange",root, 
function (name) 
    if getElementType(source) == "player" then 
                if name == "acl" then 
                          triggerClientEvent(source,"Accoun",source) 
           end 
     end 
end 
) 

c

addEvent ( "Accoun", true ) 
addEventHandler ( "Accoun", root, 
    function () 
   if getElementData( getLocalPlaye(),"acl") then 
        guiSetText ( Lebelacl, tostring(getElementData(getLocalPlayer(),"acl")) )   
    else 
        guiSetText ( Lebelacl, "N/A")  end 
    end 
) 

Link to comment
-- Server Side  
  
function getPlayerAllGroups(player) 
    local account = getPlayerAccount ( player) 
    if ( isGuestAccount ( account ) ) then 
        return false 
    end 
                  local  AclList = {} 
                                  AclList["Groups"] = {} 
                  AclList["getGroups"] = {} 
        for _, group in ipairs ( aclGroupList() ) do 
                table.insert ( AclList["Groups"],aclGroupGetName ( group ) ) 
        end 
        for k ,v in pairs(AclList.Groups) do 
            if isObjectInACLGroup ( "user."..getAccountName ( account ), aclGetGroup (v) )then 
                table.insert ( AclList["getGroups"],v) 
            end 
        end 
        return table.concat(AclList.getGroups, ",") 
end 
  
addEvent('get',true) 
addEventHandler('get',root, function ( thePlr ) 
if ( not isGuestAccount ( getPlayerAccount ( thePlr ) ) ) then 
triggerClientEvent(thePlr,'setGr',thePlr,getPlayerAllGroups ( thePlr )) 
else 
triggerClientEvent(thePlr,'setGr1',thePlr) 
end 
 end) 
  
 -- Client Side  
  
 addEventHandler('onClientResourceStart',resourceRoot, function ( ) 
 triggerServerEvent('get',localPlayer) 
 end) 
  
 addEvent('setGr',true) 
 addEventHandler('setGr',root, function ( groups ) 
 if ( groups ) then 
 guiSetText(Lebelacl,tostring(groups)) 
 end 
  end) 
   
   addEvent('setGr1',true) 
 addEventHandler('setGr1',root, function (  ) 
 guiSetText(Lebelacl,'N\A') 
  end) 

ماجربته ,

Link to comment
-- Server Side  
  
function getPlayerAllGroups(player) 
    local account = getPlayerAccount ( player) 
    if ( isGuestAccount ( account ) ) then 
        return false 
    end 
                  local  AclList = {} 
                                  AclList["Groups"] = {} 
                  AclList["getGroups"] = {} 
        for _, group in ipairs ( aclGroupList() ) do 
                table.insert ( AclList["Groups"],aclGroupGetName ( group ) ) 
        end 
        for k ,v in pairs(AclList.Groups) do 
            if isObjectInACLGroup ( "user."..getAccountName ( account ), aclGetGroup (v) )then 
                table.insert ( AclList["getGroups"],v) 
            end 
        end 
        return table.concat(AclList.getGroups, ",") 
end 
  
addEvent('get',true) 
addEventHandler('get',root, function ( thePlr ) 
if ( not isGuestAccount ( getPlayerAccount ( thePlr ) ) ) then 
triggerClientEvent(thePlr,'setGr',thePlr,getPlayerAllGroups ( thePlr )) 
else 
triggerClientEvent(thePlr,'setGr1',thePlr) 
end 
 end) 
  
 -- Client Side  
  
 addEventHandler('onClientResourceStart',resourceRoot, function ( ) 
 triggerServerEvent('get',localPlayer) 
 end) 
  
 addEvent('setGr',true) 
 addEventHandler('setGr',root, function ( groups ) 
 if ( groups ) then 
 guiSetText(Lebelacl,tostring(groups)) 
 end 
  end) 
   
   addEvent('setGr1',true) 
 addEventHandler('setGr1',root, function (  ) 
 guiSetText(Lebelacl,'N\A') 
  end) 

ماجربته ,

مو شغال

Link to comment
addEvent('get',true) 
addEventHandler('get',root, function ( thePlr ) 
local groups = getPlayerAllGroups ( thePlr ) 
if ( groups ) then 
triggerClientEvent(thePlr,'setGr',thePlr,groups) 
else 
triggerClientEvent(thePlr,'setGr1',thePlr) 
end 
 end) 

Link to comment
function getPlayerAllGroups(player) 
    local account = getPlayerAccount ( player) 
    if ( isGuestAccount ( account ) ) then 
        return false 
    end 
                  local  AclList = {} 
                                  AclList["Groups"] = {} 
                  AclList["getGroups"] = {} 
        for _, group in ipairs ( aclGroupList() ) do 
                table.insert ( AclList["Groups"],aclGroupGetName ( group ) ) 
        end 
        for k ,v in pairs(AclList.Groups) do 
            if isObjectInACLGroup ( "user."..getAccountName ( account ), aclGetGroup (v) )then 
                table.insert ( AclList["getGroups"],v) 
            end 
        end 
        return table.concat(AclList.getGroups, ",") 
end 

حط ذأ بـ ملف السيرفر ..

Link to comment

Client

addEventHandler("onClientElementDataChange", root, function(data) 
    if source == localPlayer and data == "Groups" then 
        guiSetText(Lebelacl, getElementData(source, "Groups")) 
    end 
end) 

Server

function getPlayerAllGroups(player) 
    local account = getPlayerAccount ( player) 
    if ( isGuestAccount ( account ) ) then 
        return false 
    end 
                  local  AclList = {} 
                                  AclList["Groups"] = {} 
                  AclList["getGroups"] = {} 
        for _, group in ipairs ( aclGroupList() ) do 
                table.insert ( AclList["Groups"],aclGroupGetName ( group ) ) 
        end 
        for k ,v in pairs(AclList.Groups) do 
            if isObjectInACLGroup ( "user."..getAccountName ( account ), aclGetGroup (v) )then 
                table.insert ( AclList["getGroups"],v) 
            end 
        end 
        return table.concat(AclList.getGroups, ",") 
end 
  
addEventHandler("onPlayerLogin", root, function( ) 
    setElementData(source, "Groups", getPlayerAllGroups(source) or "N/A") 
end) 
  
addEventHandler("onPlayerLogout", root, function( ) 
    setElementData(source, "Groups", "N/A") 
end) 
  
addEventHandler("onResourceStart", resourceRoot, function( ) 
    for k,v in ipairs(getElementsByType("player")) do 
        setElementData(v, "Groups", getPlayerAllGroups(v) or "N/A") 
    end 
end) 
Link to comment
Client

addEventHandler("onClientElementDataChange", root, function(data) 
    if source == localPlayer and data == "Groups" then 
        guiSetText(Lebelacl, getElementData(source, "Groups")) 
    end 
end) 

Server

function getPlayerAllGroups(player) 
    local account = getPlayerAccount ( player) 
    if ( isGuestAccount ( account ) ) then 
        return false 
    end 
                  local  AclList = {} 
                                  AclList["Groups"] = {} 
                  AclList["getGroups"] = {} 
        for _, group in ipairs ( aclGroupList() ) do 
                table.insert ( AclList["Groups"],aclGroupGetName ( group ) ) 
        end 
        for k ,v in pairs(AclList.Groups) do 
            if isObjectInACLGroup ( "user."..getAccountName ( account ), aclGetGroup (v) )then 
                table.insert ( AclList["getGroups"],v) 
            end 
        end 
        return table.concat(AclList.getGroups, ",") 
end 
  
addEventHandler("onPlayerLogin", root, function( ) 
    setElementData(source, "Groups", getPlayerAllGroups(source) or "N/A") 
end) 
  
addEventHandler("onPlayerLogout", root, function( ) 
    setElementData(source, "Groups", "N/A") 
end) 
  
addEventHandler("onResourceStart", resourceRoot, function( ) 
    for k,v in ipairs(getElementsByType("player")) do 
        setElementData(v, "Groups", getPlayerAllGroups(v) or "N/A") 
    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...