Jump to content

guiGridListGetItemText Problem


Karuzo

Recommended Posts

Hey Guys,

so i have a little problem with my World-Panel.

i want to check which row the player has selected.

but it doesn't really works.

function DeathMatchMaps() 
    if guiGridListGetItemText(World.gridlist[1],guiGridListGetSelectedItem(World.gridlist[1])) ~= "1200" then 
        triggerServerEvent("DeathMatch1" , getLocalPlayer()) 
        outputChatBox("Deathmatch 1'ye warplandin!", 0, 255,0, false) 
    elseif (guiGridListGetItemText == DM2) and (guiGridListGetItemText == DMDim2) then 
        triggerServerEvent("DeathMatch1", getLocalPlayer()) 
        outputChatBox("Deathmatch 2'ye warplandin!", 0, 255, 0, false) 
    end 
end 
addEventHandler("onClientGUIClick", World.button[1], DeathMatchMaps) 

I think that's all you'll need :-)

Thank you for your help.

Link to comment

Try this:

function DeathMatchMaps() 
    local row, col = guiGridListGetSelectedItem ( World.gridlist[1] ) 
    if ( row == -1 ) then return end 
    local text = guiGridListGetItemText ( World.gridlist[1], row, col ) 
    if ( text == "1200" ) then 
        triggerServerEvent("DeathMatch1" , getLocalPlayer() ) 
        outputChatBox("Deathmatch 1'ye warplandin!", 0, 255,0, false) 
         
    elseif ( text == "DM2" ) then 
        triggerServerEvent("DeathMatch1", getLocalPlayer()) 
        outputChatBox("Deathmatch 2'ye warplandin!", 0, 255, 0, false) 
    end 
end 
addEventHandler("onClientGUIClick", World.button[1], DeathMatchMaps) 

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