Jump to content

help with police GUI


xXMADEXx

Recommended Posts

Can someone help me make it so that this gui works properly? I want it so that it only works for Police, FBI, MIlitary, and Swat.

And, i am not sure how to make the colums work. I only got the "player" colum working. Thanks in advance.

function cancelPedDamage ( attacker ) 
    cancelEvent() 
end 
addEventHandler ( "onClientPedDamage", getRootElement(), cancelPedDamage ) 
  
police_window = guiCreateWindow(350,205,728,380,"RoG Police Window",false) 
guiSetVisible(police_window, false) 
guiSetAlpha(police_window,1) 
guiWindowSetSizable(police_window,false) 
  
playerList = guiCreateGridList(14,34,699,272,false,police_window) 
column_name = guiGridListAddColumn(playerList,"Name",0.2) 
column_team = guiGridListAddColumn(playerList,"Team",0.2) 
column_wanted = guiGridListAddColumn(playerList,"Wanted-Level",0.2) 
  
police_closeBTN = guiCreateButton(163,325,416,36,"Close",false,police_window) 
  
bindKey("F4", "down", 
function ( ) 
    --local playerTeam = getPlayerTeam ( source ) 
    --if ( playerTeam == "Police" ) or ( playerTeam == "Military" ) or  ( playerTeam == "FBI" ) or ( playerTeam == "Swat" ) then 
        guiSetVisible(police_window, not guiGetVisible ( police_window )) 
        showCursor(guiGetVisible ( police_window )) 
        if ( guiGetVisible ( police_window ) ) then 
            guiGridListClear ( playerList ) 
            if ( column_name ) then 
                for id, player in ipairs ( getElementsByType ( "player" ) ) do 
                    local row = guiGridListAddRow ( playerList ) 
                    guiGridListSetItemText ( playerList, row, column_name, getPlayerName ( player ), false, false ) 
                    guiGridListSetItemColor ( playerList, row, column_name, 255, 0, 0 ) 
                end 
            end 
            if ( column_team ) then 
                for i,team in ipairs(teams) do 
                    local row = guiGridListAddRow ( playerList ) 
                    guiGridListSetItemText ( playerList, row, column_team, getTeamName(getPlayerTeam(player)), false, false ) 
                    guiGridListSetItemColor ( playerList, row, column_team, 255, 0, 0 ) 
                end 
            end 
        end 
    --end 
end 
) 
  
-- Close Button 
function close() 
guiSetVisible(police_window, false) 
showCursor(false,false) 
end 
addEventHandler("onClientGUIClick", police_closeBTN, close) 

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