Jump to content

طلب اكواد ضروري


Recommended Posts

سلام عليكم ورحمة الله وبركاتو

شباب  انا بدي اعمل لوحة قريد ليست بدي اضيف عليه لاعبين يلي معهم رتب اريد اكواد لما لاعب يكون معو رتبة تضيفه فيها لوحدها وشكرا

Edited by ryan112
Link to comment
function putPlayers()
	guiGridListClear(GUIEditor.gridlist[1])
	for i,player in ipairs(getElementsByType("player")) do
	local account = getPlayerAccount ( player )
	for _, group in ipairs ( { "Admin", "Console", "", "" } ) do  
	if isObjectInACLGroup ( "user.".. getAccountName ( account ), aclGetGroup ( group ) )   then
		local row = guiGridListAddRow(Grid)
		guiGridListSetItemText(Grid,row,1,getPlayerName(player),false,false)
	end
end
addEventHandler ( "onClientResourceStart", getRootElement(), putPlayers )

 

Link to comment
--Client
addEvent("putPlayers", true )
addEventHandler("putPlayers", root,
function (players)
	guiGridListClear(Grid)
		local row = guiGridListAddRow(Grid)
		guiGridListSetItemText(Grid,row,1,getPlayerName(players),false,false)
	end
)
triggerServerEvent("GetPlayers",localplayer)

--Server
addEvent("GetPlayers", true )
addEventHandler("GetPlayers", root,
function ()
	for i,player in ipairs(getElementsByType("player")) do
	local account = getPlayerAccount ( player )
	for _, group in ipairs ( { "Admin", "Console", "", "" } ) do  
	if isObjectInACLGroup ( "user.".. getAccountName ( account ), aclGetGroup ( group ) )   then
	triggerClientEvent("putPlayers",root, player)
			end
		end
	end
end
)

 

Link to comment
function aclGroupGetPlayers(groupName)
    local players = {}
	if groupName and aclGetGroup(groupName) then
		local group = aclGetGroup(groupName)
		local objects = aclGroupListObjects(group) or {}
        for _,object in ipairs(objects) do
            local isAccount = gettok(object, 1, string.byte("."))
            if isAccount and isAccount == "user" then
                local account = gettok(object, 2, string.byte("."))
				if account and getAccount(account) then
					local player = getAccountPlayer(getAccount(account))
					if player and isElement(player) then
						table.insert(players, player)
					end
				end
			end
		end
	end
	return players 
end
--By ME :D

 

Edited by #َxLysandeR
Link to comment
--client
GUIEditor = {
    gridlist = {},
    window = {},
    button = {}
}
GUIEditor.window[1] = guiCreateWindow(491, 202, 257, 327, "Importanta people", false)
guiWindowSetSizable(GUIEditor.window[1], false)

GUIEditor.button[1] = guiCreateButton(68, 291, 113, 26, "Close", false, GUIEditor.window[1])
Grid = guiCreateGridList(9, 23, 238, 258, false, GUIEditor.window[1])
guiGridListAddColumn(Grid, "Player", 0.5)
guiGridListAddColumn(Grid, "Rank", 0.5)
   
addEvent("putPlayers", true )
addEventHandler("putPlayers", root,
function (players)
	guiGridListClear(Grid)
		local row = guiGridListAddRow(Grid)
		guiGridListSetItemText(Grid,row,1 ,getPlayerName(players),false,false)
	end
)
triggerServerEvent("GetPlayers",localPlayer)

   

function onGuiClick() 
if (source == GUIEditor.button[1]) then 
guiSetVisible(GUIEditor.window[1], false) 
showCursor(false) 
end 
end 
addEventHandler("onClientGUIClick", root, onGuiClick)

function toggleWindow()
	if (guiGetVisible(GUIEditor.window[1]) == true) then             
        guiSetVisible(GUIEditor.window[1], false)
		showCursor(false)
	else              
        guiSetVisible(GUIEditor.window[1], true)
		showCursor(true)
	end
end
bindKey("f5", "down", toggleWindow)


function closeWindowAtStart()
	guiSetVisible(GUIEditor.window[1], false)
end
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()),closeWindowAtStart)

--server
addEvent("GetPlayers", true )
addEventHandler("GetPlayers", root,
function ()
	for i,player in ipairs(getElementsByType("player")) do
	local account = getPlayerAccount ( player )
	for _, group in ipairs ( { "Owner", "Admin",  "SuperModerator", "Moderator" , "VIP" } ) do  
	if isObjectInACLGroup ( "user.".. getAccountName ( account ), aclGetGroup ( group ) )   then
	triggerClientEvent("putPlayers",root, player)
			end
		end
	end
end
)

شباب انا بدي يعرض اسم رتبة ولاعب وازا خرج يصر اسمو غامق

Link to comment
addEvent("GetPlayers", true )
addEventHandler("GetPlayers", root,
function ()
	for i,player in ipairs(getElementsByType("player")) do
	local account = getPlayerAccount ( player )
	for _, group in ipairs ( { "Owner", "Admin",  "SuperModerator", "Moderator", "VIP", "Developer" } ) do  
	if isObjectInACLGroup ( "user.".. getAccountName ( account ), aclGetGroup ( group ) ) then
	triggerClientEvent("putPlayers",root, player)
			end
		end
	end
end
)

function aclGroupGetPlayers(groupName)
    local players = {}
	if groupName and aclGetGroup(groupName) then
		local group = aclGetGroup(groupName)
		local objects = aclGroupListObjects(group) or {}
        for _,object in ipairs(objects) do
            local isAccount = gettok(object, 1, string.byte("."))
            if isAccount and isAccount == "user" then
                local account = gettok(object, 2, string.byte("."))
				if account and getAccount(account) then
					local player = getAccountPlayer(getAccount(account))
					if player and isElement(player) then
						table.insert(players, player)
					end
				end
			end
		end
	end
	return players 
end

هي ملف سيرفر

6 hours ago, ryan112 said:

--client
GUIEditor = {
    gridlist = {},
    window = {},
    button = {}
}
GUIEditor.window[1] = guiCreateWindow(491, 202, 257, 327, "Importanta people", false)
guiWindowSetSizable(GUIEditor.window[1], false)

GUIEditor.button[1] = guiCreateButton(68, 291, 113, 26, "Close", false, GUIEditor.window[1])
Grid = guiCreateGridList(9, 23, 238, 258, false, GUIEditor.window[1])
guiGridListAddColumn(Grid, "Player", 0.5)
guiGridListAddColumn(Grid, "Rank", 0.5)
   
addEvent("putPlayers", true )
addEventHandler("putPlayers", root,
function (players)
	guiGridListClear(Grid)
		local row = guiGridListAddRow(Grid)
		guiGridListSetItemText(Grid,row,1 ,getPlayerName(players),false,false)
	end
)
triggerServerEvent("GetPlayers",localPlayer)

   

function onGuiClick() 
if (source == GUIEditor.button[1]) then 
guiSetVisible(GUIEditor.window[1], false) 
showCursor(false) 
end 
end 
addEventHandler("onClientGUIClick", root, onGuiClick)

function toggleWindow()
	if (guiGetVisible(GUIEditor.window[1]) == true) then             
        guiSetVisible(GUIEditor.window[1], false)
		showCursor(false)
	else              
        guiSetVisible(GUIEditor.window[1], true)
		showCursor(true)
	end
end
bindKey("f5", "down", toggleWindow)


function closeWindowAtStart()
	guiSetVisible(GUIEditor.window[1], false)
end
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()),closeWindowAtStart)

شباب انا بدي يعرض اسم رتبة ولاعب وازا خرج يصر اسمو غامق

 

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