Jump to content

Help .. GridList ..


iPrestege

Recommended Posts

Hello , i have a problem here in my top "Drift" SetItemText it,s not working just the window -_-" here you are the client side :

GUIEditor = { 
    gridlist = {}, 
    label = {}, 
} 
function centerWindow(center_window) 
    local screenW,screenH=guiGetScreenSize() 
    local windowW,windowH=guiGetSize(center_window,false) 
    local x,y = (screenW-windowW)/2,(screenH-windowH)/2 
    guiSetPosition(center_window,x,y,false) 
end 
  
TopDriftWnd = guiCreateWindow(0, 0, 0, 0, "==[ Top 25 Drift ]==", false) 
centerWindow(TopDriftWnd) 
guiWindowSetMovable(TopDriftWnd, false) 
guiWindowSetSizable(TopDriftWnd, false) 
guiSetAlpha(TopDriftWnd, 1.00) 
guiSetProperty(TopDriftWnd, "CaptionColour", "FFFFFC00") 
  
GUIEditor.gridlist[1] = guiCreateGridList(9, 26, 351, 288, false, TopDriftWnd) 
guiGridListAddColumn(GUIEditor.gridlist[1], "Rank", 0.3) 
guiGridListAddColumn(GUIEditor.gridlist[1], "PlayerName", 0.3) 
guiGridListAddColumn(GUIEditor.gridlist[1], "BestDrift", 0.3) 
  
function open() 
    guiSetVisible(TopDriftWnd,not guiGetVisible(TopDriftWnd)) 
    showCursor(guiGetVisible(TopDriftWnd)) 
    guiSetInputEnabled(guiGetVisible(TopDriftWnd)) 
    getTopDrift() 
end 
bindKey("F6","down",open) 
  
  
function getTopDrift() 
    triggerServerEvent("onGetDrift",localPlayer) 
end 
  
addEvent("onSetOnGrid",true) 
addEventHandler("onSetOnGrid",root, 
    function (drift) 
        guiGridListClear(GUIEditor.gridlist[1]) 
        for i,top in ipairs(drift) do 
            local num = guiGridListGetRowCount(GUIEditor.gridlist[1]) 
            if ( num <= 26 ) then 
                local row = guiGridListAddRow(GUIEditor.gridlist[1]) 
                local num = guiGridListGetRowCount(GUIEditor.gridlist[1]) 
                guiGridListSetItemText(GUIEditor.gridlist[1],row,1,num,false,false) 
                guiGridListSetItemText(GUIEditor.gridlist[1],row,2,top.name,false,false) 
                guiGridListSetItemText(GUIEditor.gridlist[1],row,3,top.dir,false,false) 
                guiGridListSetItemColor(GUIEditor.gridlist[1],row,2,0,255,0) 
                guiGridListSetItemColor(GUIEditor.gridlist[1],row,3,255,255,0) 
            end 
        end 
    end 
) 
  
  

Some help ^^ if you need the server side i will send it "PM" thanks ! .

Edited by Guest
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...