Jump to content

وين مشكلة ؟؟ ساعدوني من فضلكم والله مهم


Recommended Posts

Client side:

GUIEditor = {
    gridlist = {},
    window = {},
    button = {}
}
GUIEditor.window[1] = guiCreateWindow(491, 202, 257, 327, "Rank panel", false)
guiWindowSetSizable(GUIEditor.window[1], false)
guiSetVisible(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("showThePanel", true )
addEventHandler("showThePanel", root, function (players)
    if not guiGetVisible( GUIEditor.window[1] ) then
        guiGridListClear(Grid)
        for k,v in pairs(players) do
            local row = guiGridListAddRow(Grid, index,1)
			local nick = guiGridListGetItemText(Grid,index,1)
            guiGridListSetItemText(Grid,row,1 ,v[1],false,false)
            guiGridListSetItemText(Grid,row,1 ,v[2],false,false)
			end
    end
    guiSetVisible( ( GUIEditor.window[1] ),true )
	showCursor(true)
end)



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

server side: 


local acls = {
	"Owner",
	"Manager",
	"Developer",
    "Admin",
    "SuperModerator",
	"Moderator",
	"Warden",
	"VIP",
}


function toggleImportantPeople( presser )
    local tempTable = {}
    local plrs = getElementsByType( "player" )
    for _,p in pairs(plrs) do
        local rank = getRank(p)
        if rank then
            table.insert(acls, {getPlayerName( p ),rank})
        end
    end
    triggerClientEvent( presser, "showThePanel", presser, tempTable )
end

function getRank( plr )
    for _,r in pairs(acls) do
        if hasRights(plr, r) then
            return r
        end
    end
end


local plrs = getElementsByType( "player" )
for _,p in pairs(plrs) do
    bindKey ( p, "F5", "down", toggleImportantPeople)
end

addEventHandler( "onPlayerLogin", root, function( )
    bindKey ( source, "F5", "down", toggleImportantPeople)
end )

function hasRights(plr,group)
    if ACLGroup.get(group):doesContainObject("user."..plr.account.name) then
        return true
    else
     --  plr:outputChatBox("You're not allowed to use this command",plr,100,0,0,true)
        return false
    end
end

يعني بدي قريد ليست تضهر كل اسماء اللاعبين اللي معهم رتب زيما نتا شايف في acls

و تضيف اسماء لاعبين لحالها حتى ولو غير إسمو

بترجاكم سعدوني و مافي اي مشكلة في سكربت

 

Link to comment
GUIEditor = {
    gridlist = {},
    window = {},
    button = {}
}
GUIEditor.window[1] = guiCreateWindow(491, 202, 257, 327, "Rank panel", false)
guiWindowSetSizable(GUIEditor.window[1], false)
guiSetVisible(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("showThePanel", true )
addEventHandler("showThePanel", root, function (players)
    if not guiGetVisible( GUIEditor.window[1] ) then
        guiGridListClear(Grid)
        for k,v in pairs(players) do
            local row = guiGridListAddRow(Grid, index,1)
			local nick = guiGridListGetItemText(Grid,index,1)
            guiGridListSetItemText(Grid,row,1 ,v[1],false,false)
            guiGridListSetItemText(Grid,row,1 ,v[2],false,false)
			end
    end
    guiSetVisible( GUIEditor.window[1] ,true )
	showCursor(true)
end)



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

جرب المشكلة كانت عندك في سطر 26

Edited by MR.Mosa
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...