-
Posts
708 -
Joined
-
Last visited
Everything posted by K4stic
-
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
-
will test it in 1 hour because now i must go
-
nothing thats good Thx you Guys for Help you are best
-
i know how use it i ask only if i can use it to refresh Grid list's
-
#Pai_[N] can i use the also "onClientRender" to refresh grid list?
-
This is better than timer, timer make server lag
-
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()
-
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
-
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
-
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
-
it's doublicate the player names every open of gui -.-
-
its for same gui but to refresh combobos to sent money
-
ok thx but how i can now update this? for id, player in ipairs(getElementsByType("player")) do guiComboBoxAddItem(guicomboBox, getPlayerName(player)) end
-
now it show me every 5 sec the window i need to updated only text then the gui opening -.-
-
i know the finction but how make it -.-
-
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
-
Community Pls help me i need make it updatable that items because i must now restart it all time the resource