Jump to content

Cubingo

Members
  • Posts

    9
  • Joined

  • Last visited

Everything posted by Cubingo

  1. Yea, i understand now,, i've read this in the wiki, but actually i didn't perceive what it means,, Thank you castillo
  2. Hello, i have a problem which i tried to fix many many times, but really idk where the problem is coming from function clickbtn ( button, state, absoluteX, absoluteY, thePlayer) local getselected = guiGridListGetSelectedItem ( player_namesgrd ) if ( source == slap_btn ) then if getselected then if not guiGetVisible ( slap_wnd ) then guiSetVisible (slap_wnd, true) guiBringToFront ( slap_wnd ) else if not getselected then guiSetText ( slap_edit, "Please, select a player first" ) end end end end end ( this is just a part from the script ) i think the problem is from here local getselected = guiGridListGetSelectedItem ( player_namesgrd ) idk how to check if he's selecting any element at the gridlist or not,, the window is showing even if i am selecting something or not...
  3. i think this should work function pilotPanelOne () rWin = guiCreateWindow(472, 289, 158, 152, "Pilot Work", false) guiWindowSetSizable(rWin, false) leaveJob = guiCreateButton(12, 70, 136, 31, "Leave the job.", false, rWin) getJob = guiCreateButton(12, 29, 136, 31, "Get the job.", false, rWin) theClose = guiCreateButton(12, 111, 136, 31, "Close.", false, rWin) outputChatBox ("Works") showCursor (true) end addEvent ("pilotPanelOne", true) addEventHandler ("pilotPanelOne", getLocalPlayer(), pilotPanelOne) function whenPlayerClickToClose (button, state, absoluteX, absoluteY) if ( source == theClose ) then outputChatBox ("Works") guiSetVisible (rWin, false) showCursor (false) end addEventHandler ("onClientGUIClick", theClose, whenPlayerClickToClose)
  4. i said i don't want it to be with a timer, i just want it to refresh everytime someone joins or leaves...
  5. i meant to refresh the gridlist which contains all the players, everytime someone joins, so if someone joined he would be added to the list, i thought of doing it with a timer like refreshing the list every 5 seconds but that will be annoying... function playersin() column = guiGridListAddColumn(player_namesgrd, "Player name", 0.9) if ( column ) then for id, playeritem in ipairs(getElementsByType("player")) do local row = guiGridListAddRow ( player_namesgrd ) guiGridListSetItemText ( player_namesgrd, row, column, getPlayerName ( playeritem ), false, false ) end end end addEventHandler ( "onClientResourceStart", getRootElement(), playersin ) does this will add a player everytime someone joins and will remove him when he leaves or not ? if not then how to make remove him ?? that's my question
  6. or when someone leaves ? setTimer ( 'functionname', 5000, 0 ) i know this could work but is there another way of setting a timer ?? Thx for answering, i am still a beginner how could i know if i didn't ask ?? i am sure hypex that you were like me before, but this section which you should ask in, you learnt from it as i do,,, And sorry, another question. how could i loop through a table ??
  7. Sorry for late response, i have made a gridlist which contains all the players online but there is a problem function slapbtn ( thePlayer ,button, state, absoluteX, absoluteY) if ( source == slap_btn ) then local playername = guiGridListGetItemText ( player_namesgrd, guiGridListGetSelectedItem ( player_namesgrd ), column ) if playername then setElementHealth ( playername, 20 ) outputChatBox ( ""..playername.."Done" ) -- Test output end end end addEventHandler( "onClientGUIClick", slap_btn, slapbtn) when i click on the button it outputs the playername but it doesn't set his health bad argument @ 'setElementHealth' and i have a question -- how to make it refresh the list everytime someonejoins ?
  8. what ? i want an explanation please, the idea is to make a row for each wanted player, not for just 1
  9. i wanted to loop through all the players online and pickup the wanted's and put them into a gridlist but idk how that works,,, if someone can explain me detailed please, how to loop through the wanted player, and put them into a gridlist i found this at the wiki but idk how to continue local players = getElementsByType ( "player" ) -- get a table of all the players in the server for theKey,thePlayer in ipairs(players) do -- use a generic for loop to step through each player local level = getPlayerWantedLevel ( thePlayer ) -- get the wanted level of the player if ( level > 0 ) then
×
×
  • Create New...