Jump to content

K4stic

Members
  • Posts

    708
  • Joined

  • Last visited

Everything posted by K4stic

  1. K4stic

    Panel Help

    Guys Officialy i can say because i test it! Now you can use "onClientRender" To refresh your Grid list's this is my example of my code: addEventHandler("onClientRender", root, function() guiGridListClear( userPanelGrid1 ) guiGridListClear( userPanelGrid2 ) for key,player in pairs(getElementsByType("player")) do local row = guiGridListAddRow(userPanelGrid1) local row2 = guiGridListAddRow(userPanelGrid2) guiGridListSetItemText(userPanelGrid1, row, playerCol, getPlayerName(player), false, false) guiGridListSetItemText(userPanelGrid2, row2, playerCol2, getPlayerName(player), false, false) end end ) this is useful to no use Timers and server have LAG so Try it
  2. K4stic

    Panel Help

    will test it in 1 hour because now i must go
  3. K4stic

    Panel Help

    nothing thats good Thx you Guys for Help you are best
  4. K4stic

    Panel Help

    i know how use it i ask only if i can use it to refresh Grid list's
  5. K4stic

    Panel Help

    #Pai_[N] can i use the also "onClientRender" to refresh grid list?
  6. K4stic

    Panel Help

    This is better than timer, timer make server lag
  7. K4stic

    Panel Help

    help pls it's refresh only the userPanelGrid1 and no refresh the userPanelGrid2 function playerGridUpdate() if (alreadyHandled) then return false end for key,player in pairs(getElementsByType("player")) do local row = guiGridListAddRow(userPanelGrid1) local row2 = guiGridListAddRow(userPanelGrid2) guiGridListSetItemText(userPanelGrid1, row, playerCol, getPlayerName(player), false, false) guiGridListSetItemText(userPanelGrid2, row2, playerCol2, getPlayerName(player), false, false) end alreadyHandled = true end function playerGridJoinUpdate() if (tostring(guiGetText(userPanelEdit2)) == "") then local row = guiGridListAddRow(userPanelGrid1) local row2 = guiGridListAddRow(userPanelGrid2) guiGridListSetItemText(userPanelGrid1, row, playerCol, getPlayerName(source), false, false) guiGridListSetItemText(userPanelGrid2, row2, playerCol2, getPlayerName(source), false, false) end end addEventHandler("onClientPlayerJoin", root, playerGridJoinUpdate) function playerGridQuitUpdate() local count = guiGridListGetRowCount(userPanelGrid1) for i = 0, count do local item = guiGridListGetItemText(userPanelGrid1, i, 1) if (item == getPlayerName(source)) then guiGridListRemoveRow(userPanelGrid1, i) guiGridListRemoveRow(userPanelGrid2, i) end end end addEventHandler("onClientPlayerQuit", root, playerGridQuitUpdate) function playerGridRenameUpdate(old, new) local count = guiGridListGetRowCount(userPanelGrid1) for i = 0, count do local item = guiGridListGetItemText(userPanelGrid1, i, 1) local item = guiGridListGetItemText(userPanelGrid2, i, 1) if (item == old) or (item1 == old) then guiGridListSetItemText(userPanelGrid1, i, 1, new, false, false) guiGridListSetItemText(userPanelGrid2, i, 1, new, false, false) end end end addEventHandler("onClientPlayerChangeNick", root, playerGridRenameUpdate) playerGridUpdate()
  8. K4stic

    Help gui

    anyway thx you guys
  9. K4stic

    Help gui

    Thx @Renkon i forgot that the 'getPlayerTeam' is Server side Thx for Try @DNL291 but will not work because 'getPlayerTeam' is Server Side function but now i use Element Data and it work
  10. K4stic

    Help gui

    my fail maybe i need use Element data?
  11. K4stic

    Help gui

    addEventHandler("onClientGUIClick", root, function () if (source == takebtn) then if not( getPlayerTeam ( localPlayer, getTeamFromName("Unemployed") ) ) then outputChatBox("You must Quit From your Job first",255,0,0) return end local row,col = guiGridListGetSelectedItem(skinsgrid) if (row and col and row ~= -1 and col ~= -1) then local skinName = guiGridListGetItemText(skinsgrid, row, 1) if skinName == "Medic 1 (skin: 274)" then triggerServerEvent("setMedic",localPlayer,274) elseif skinName == "Medic 2 (skin: 275)" then triggerServerEvent("setMedic",localPlayer,275) elseif skinName == "Medic 3 (skin: 276)" then triggerServerEvent("setMedic",localPlayer,276) end guiSetVisible(windowjob, false) showCursor(false) else outputChatBox("Please,select a skin of the list.",255,0,0) end elseif (source == closebtn) then guiSetVisible(windowjob, false) showCursor(false) end end ) No errors just nothing How i can make it then player click on takebtn and player not Unemployed to output him/her Message
  12. Dzsipszi i have see this script somethere for free it's posted on an Rusian MTAsa site in scripts section and you can download it free but not remember the site
  13. K4stic

    gui help

    thx you Jaysds1 now it's work
  14. K4stic

    Help me KDR

    addEventHandler ( "onPlayerWasted", root, function( totalAmmo, killer, killerWeapon, bodypart, stealth ) if killer then local account = getPlayerAccount ( killer ) if killer ~= source then setAccountData( account,"TK",tonumber( getAccountData( account,"TK" ) or 0 ) +1 ) setElementData( killer, "TK", tonumber( getAccountData( account,"TK" ) ) ) setElementData( killer, "KDR", tonumber(getElementData( killer, "TK" )/getElementData( killer, "TD") ) ) end else local accountSource = getPlayerAccount ( source ) setAccountData( accountSource,"TD",tonumber( getAccountData(accountSource,"TD") or 0 ) +1 ) setElementData( source, "TD", tonumber( getAccountData( accountSource,"TD" ) ) ) setElementData( source, "KDR", tonumber(getElementData( source, "TK" ))/tonumber(getElementData( source, "TD"))) end end ) then killer kill someone his Kills up but then player die by killer he not get +1 death
  15. K4stic

    gui help

    it's doublicate the player names every open of gui -.-
  16. K4stic

    gui help

    its for same gui but to refresh combobos to sent money
  17. K4stic

    gui help

    ok thx but how i can now update this? for id, player in ipairs(getElementsByType("player")) do guiComboBoxAddItem(guicomboBox, getPlayerName(player)) end
  18. K4stic

    gui help

    now it show me every 5 sec the window i need to updated only text then the gui opening -.-
  19. K4stic

    gui help

    i know the finction but how make it -.-
  20. K4stic

    gui help

    then in game i charge to my self the Occupation the text no charget or then i kill someone it's not update the Total Kills
  21. K4stic

    gui help

    Community Pls help me i need make it updatable that items because i must now restart it all time the resource
×
×
  • Create New...