Jump to content

simple gui problem


Recommended Posts

hi i am developing my own admin panel and i've run into a simple problem

e.g when banning a player by pressing a button

  
--i want only that a player gets banned if he (his row) is selected in a gridlist 
  
-- i am using this check 
   if guiGridListGetSelectedItem(playerList) then 
  
--event 
addEventHandler("onClientGUIClick",root,onAdminClick) 
  

problem is that i can ban a player even if i didn't select anyone on the gridlist -- in that case a random player gets banned

am i using this function wrongly or do i need to do additional check or what?

please help

Link to comment

If it's a grid list then you don't need to compare the item text with anything. -1 is the selected item if no item is selected, so you just need to make sure that the selected item index is not -1.

if guiGridListGetSelectedItem(playerList) ~= -1 then 

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