-
Posts
2,947 -
Joined
-
Last visited
Everything posted by JR10
-
No, you only need to clear the grid if you want to fill it again from scratch cleaing the grid list will clear every row in it which is needed in order not to have the players doubled because refreshGridlist will fill it from scratch.
-
Oh you are right replace it with this: function refreshGridlist() guiGridListClear(gridList) for i, v in ipairs(getElementsByType('player')) do local row = guiGridListAddRow(gridList) guiGridListSetItemText(gridList, row, 1, getPlayerName(v), false, false) guiGridListSetItemText(gridList, row, 2, getPlayerState(v), false, false) end end
-
Are you sure about this: {'btn', id='Use', onclick=attachElements} i think it should be the function like this: {'btn', id='Use', onclick=onDoubleClick}
-
You need first to find the TXD name of the road which you can do it using MEd and then extract that TXD file with img tool and edit it then save it then script it.
-
Hmm put the two functions outside wndIcon, if this happens again post the line.
-
Then you need img tool , txd workshop, some TXD editor program, and mta functions engineImportTXD engineLoadCOL engineLoadDFF engineLoadTXD engineReplaceCOL engineReplaceModel engineRestoreCOL engineRestoreModel And don't ask me how to edit a TXD learn that on youtube or something.
-
setTimer(refreshGridlist, 1000, 0)
-
On What a road?? then it's txd replacment.
-
I don't understand do you want to change TXD or DFF?? you should use: engineImportTXD engineLoadCOL engineLoadDFF engineLoadTXD engineReplaceCOL engineReplaceModel engineRestoreCOL engineRestoreModel
-
i forgot an end here wndIcon = { 'wnd', text = 'Icon Window', width = 250, controls = { { 'lst', id='IconGridList', width=230, height=280, columns={ {text='Icons', attr='name'} }, rows={xml='icons.xml', attrs={'id', 'name'}}, function getIconIDByName(name) for i, v in ipairs(getElementsByType('icon')) do if getElementData(v, 'name') == name then return tonumber(getElementData(v, 'id')) end end end function onDoubleClick(botton, state) local row, column = guiGridListGetSelectedItem(IconGridList) local text = guiGridListGetItemText(IconGridList, row, column) local icon = getIconIDByName(text) local leaf = createPickup(0, 0, 0, 3, icon) attachElements(leaf, g_Me, 0, 0, 1.5) end }, {'btn', id='Use', onclick=attachElements}, {'btn', id='Close', closeswindow=true} } } Sorry. And i never edited the FR but is this right?? {'btn', id='Use', onclick=attachElements} shouldn't it be {'btn', id='Use', onclick=onDoubleClick} im just saying, i never looked in the FR resource before so maybe you are right.
-
All you need to do is make a timer that will get all players and and set his state in the gridlist. example: function getPlayerState(player) if getElementHealth(player) > 0 then return 'Alive' else return 'Dead' end end function refreshGridlist() for i, v in ipairs(getElementsByType('player')) do local row = guiGridListAddRow(gridList) guiGridListSetItemText(gridList, row, 1, getPlayerName(v), false, false) guiGridListSetItemText(gridList, row, 2, getPlayerState(v), false, false) end end Now edit gridList to your grid list variable and set a timer for refreshGridlist function. Good luck.
-
--server side local streamedElements = {} function GetStreamedElements(player, type) triggerClientEvent('streamedElements', root, type) end addEvent('insertStreamedElement', true) addEventHandler('insertStreamedElement', root, function(element) table.insert(streamedElements, element) end ) --client side addEvent('streamedElements', true) addEventHandler('streamedElements', root, function(type) for i, v in ipairs(getElementsByType(type)) do if isElementStreamedIn(v) then triggerServerEvent('insertStreamedElement', root, v) end end end ) if it worked then you will have a table "streamedElements" full of streamed elements server side whenever you use the function. Good luck.
-
function(leaf) attachElements(leaf, g_Me, 0, 0, 1.5) end if this function is onClientGUIDoubleClick then leaf is not the icon it is The Parameters for the event string button, string state, int absoluteX, int absoluteY you should do this function getIconIDByName(name) for i, v in ipairs(getElementsByType('icon')) do if getElementData(v, 'name') == name then return tonumber(getElementData(v, 'id')) end end end Use the above function function to retrieve the icon id from it's name you can get the name by the below is onClientGUIDoubleClick function onDoubleClick(botton, state) local row, column = guiGridListGetSelectedItem(IconGridList) local text = guiGridListGetItemText(IconGridList, row, column) local icon = getIconIDByName(text) local leaf = createPickup(0, 0, 0, 3, icon) attachElements(leaf, g_Me, 0, 0, 1.5) but make sure to change IconGridList to your gridlist.
-
functions: dxDrawText getScreenFromWorldPosition example: local x, y, z = getElementPosition(theMarker) local sx, sy = getScreenFromWorldPosition(x, y, z+3) dxDrawText('MARKER', x, y, --rest of the arguments
-
you can do this for i, v in ipairs(getEkementsByType('vehicle')) do if isElementStreamedIn(v) then return v end end
-
change replace.lua to addEventHandler('onClientResourceStart', root, function() setTimer( function() local txd = engineLoadTXD("107.txd") engineImportTXD(txd, 107) end , 500, 1) end ) Try this.
-
No i want the resource not only the TXD you can post the scripts in it here no need for download.
-
No problem.
-
Ok now post all the scripts in fam3 resource all lua scripts and the meta.xml
-
Yes ofc, create the pick up and use onPickupHit and see if the hitElement is a vehicle and use setElementModel to change the vehicle. It's really easy.
-
Ok did you add the txd file to the meta?? Did you type the path correctly because 107.txd might be in a directory.