-
Posts
4,961 -
Joined
-
Last visited
Everything posted by Jaysds1
-
You could still use the code I've posted above, but you would need to add the guiSetText for the labels you would like to change.
-
Oh, I misread your code. You were checking if the text is -1 not if the selected row is -1. Try my code again.
-
Try this: for _,v in ipairs(getElementsByType("player"))do local row = guiGridListAddRow(GUIEditor.gridlist[1]) local playerName = getPlayerName(v) guiGridListSetItemText(GUIEditor.gridlist[1],row,1,playerName,false,false) end addEventHandler("onClientGUIClick",GUIEditor.gridlist[1], function(b) if b ~= "left" then return end local row,column = guiGridListGetSelectedItem(source) if row == -1 then return end local playerName = guiGridListGetItemText(GUIEditor.gridlist[1],row,column) local player = getPlayerFromName(playerName) if not playerName then guiGridListRemoveRow(row) return end local playerHealth = getElementHealth(player) local playerArmour = getPedArmor(player) end end,false)
-
If you want to set a text on the client-side, you should be triggering over to the client-side event. try this: --Client function createwindow() if not guiGetVisible ( window1 ) then local playerTeam = getPlayerTeam ( localPlayer ) if getTeamName(playerTeam) == "Police" then guiSetVisible (window1, true) triggerServerEvent ( "setarrests", localPlayer, playerTeam) end else guiSetVisible (window1, false) end end addCommandHandler ( "pcomp", createwindow ) addEvent("getArrestData",true) function getArrestData(data) guiSetText ( arrests_lab2, data ) end addEventHandler("getArrestData",root,getArrestData) --Server function getdatas() local theAccount = getPlayerAccount ( source ) local getdata = getAccountData(theAccount, "Arrests.count") or "0" triggerClientEvent(client,"getArrestData",client,tostring(getdata)) end addEvent("setarrests", true) addEventHandler("setarrests", root, getdatas)
-
it's because the event handler is linked to the window, the source would always be the window and the event would only trigger if you click on the window. Try this: addEventHandler("onClientGUIClick",guiRoot,function(b) if b ~= "left" then return end if source == GUIEditor.button[2] then guiSetVisible(GUIEditor.window[1],false) showCursor(false) elseif source == GUIEditor.button[1] then local row,column = guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ) local SelectedSkin = guiGridListGetItemText ( GUIEditor.gridlist[1],row , 1 ) if row == -1 then exports["TopBarChat"]:sendClientMessage ("#0000FF* #FF0000You must select a skin first !",255,255,255,true) return end if getElementModel(localPlayer) ~= tonumber(SelectedSkin) then guiSetVisible(GUIEditor.window[1],false) showCursor(false) triggerServerEvent("onBuy",localPlayer,tonumber(SelectedSkin)) else exports["TopBarChat"]:sendClientMessage ("#0000FF* #FF0000You already have that skin !",255,255,255,true) end end end)
-
EEA - Eastern Europe Anal BBC
-
OOU - Owner Of Unisex WBB
-
You do know you could search for it on google? https://google.ca
-
How do we know that you're from Everest Community?
-
You could script this yourself, just read more about how to script on the MTA Wiki https://wiki.multitheftauto.com
-
Well, is it only you getting the lag or is it most of the players?
-
Oh, I know how you feel about work and I wish I could help but I'm currently working on other projects of my own , plus I would need to download a program for C++ to continue learning more about it.
-
Anything new with this project?
-
MTASA wiki - offline copies / online mirrors
Jaysds1 replied to MX_Master's topic in Site/Forum/Discord/Mantis/Wiki related
Why don't you use Mega? BTW, you could get it for free too -
Ya, it seems nice, but it has too much flickers and the texts go by fast at the end.
-
Nice job MTA Devs