Jump to content

roaddog

Members
  • Posts

    346
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by roaddog

  1. He basically means to say he cant script it by himself. He needs someone to do the saving and sh't. That's pretty much it. On topic: That's a good idea, tho kinda hard to make. but yeah good luck with the project.
  2. Weapons mods: https://community.multitheftauto.com/in ... s&id=10951 https://community.multitheftauto.com/in ... s&id=10354 DONE
  3. Alright, thanks for the quick reply. Edit: wait, what about I have a client/server script and I want an export function to be shared? and either way, I have a shared script, but I want an export function to be in client?
  4. Hello, so when i do if I want to make it server and client script, It can be done by adding "shared" type? It also applies to the export function? I didnt find any explanation about them in tutorials so I start this thread. One more thing, does shared script get downloaded by client like client script does? That's all, Thank you.
  5. I have found this ALTER TABLE function lately, so I want to know how to check whether the column exists by using some kind of IF NOT EXISTS statement? Any idea how to do so?
  6. Oh goddamn, Thanks TAPL Never thought of that before.
  7. jobSheet = { ['fisherman'] = "Fisherman", ['medic'] = "Paramedic", ['lumberjack'] = "Lumber Jack", } function thisshit() jobitself = getKeyFromValueInTable(jobSheet, "Fisherman") outputChatBox(tostring(jobitself)) end addEventHandler("onResourceStart", getRootElement(), thisshit) function getKeyFromValueInTable(a, b) for k,v in ipairs(a) do if v == b then return k end end return false end So I used a function which is https://wiki.multitheftauto.com/wiki/Ge ... lueInTable , but I got a problem using this function, from code above it always returns false. Why is that so?
  8. Fake (meta proved it clearly) https://community.multitheftauto.com/in ... s&id=10886 Original https://community.multitheftauto.com/in ... ls&id=8620 DONE
  9. function setTurfOwners() local realTable = sortTable() for i, v in ipairs(realTable) do local r, g, b = exports.AGGroups:getGroupColor ( v[3]) local rE = radar[v[1]] local turfColor = toJSON({r, g, b}) if (rE) then setRadarAreaColor(rE, r, g, b, 200) end if (t_owner[v[1]]) then dbExec(db, "UPDATE theturfs SET owner=?, color=? WHERE name=?", tostring(v[3]), tostring(fromJSON(turfColor)), tostring(v[1])) break else dbExec(db, "INSERT INTO theturfs SET VALUES (?, ?, ?)", tostring(v[1]), tostring(v[3]), tostring(turfColor)) -- Error t_owner[v[1]] = v[3] break end t_owner[v[1]] = v[3] end end I have got an error at line 14 debug says syntax error near SET (1) something I forgot to take a screen. Thanks in advance
  10. Use this. https://community.multitheftauto.com/in ... ls&id=1484
  11. Hey guys, I'm wondering how to get center coordinates of a colshape(rectangle one)? Well I have got clue how to get center coordinates of radararea because I know that radar area has a get size function. but how about colshape? I noticed there's no way to get colshape size getElementPosition and other method please. Thanks.
  12. call the function using this event. addEventHandler ("onClientResourceStart", getResourceRootElement(getThisResource()), function() spawnAutomat() createatmGUI() end)
  13. just remove the 9th parameter or add value for alpha, anyway default visiblility of createMarker function is to everyone so yeah. marker = createMarker (-2415.6797, -611.46582, 132.5625, "cylinder", 2, 0, 255, 0, 255) function teleport (hitElement) setElementPosition(hitElement,-2428.0566,-599.19238,132.45692) end addEventHandler("onMarkerHit",marker,teleport)
  14. roaddog

    Program for Lua

    Of course. but I used this theme as reference.
  15. roaddog

    Program for Lua

    How do you set the interface like that? Go to settings>style configurator you will figure it out.
  16. roaddog

    Program for Lua

    Notepad++ and sublime text mixed lmao http://s7.postimg.org/qkygol48r/2015_01_16_122407.png
  17. How are we supposed to know if you don't provide your code?
  18. function showGUI(p) if (p == localPlayer) then -- Add this line to check if the element hits the marker is localPlayer. --insert your script here end end addEventHandler("onClientMarkerHit",marker1,showGUI)
  19. Weapon mod: https://community.multitheftauto.com/in ... s&id=10739 DONE
  20. I did use downloadFile function to download the mods, but not retrieving file names or file sizes and put it into gridlist. I used file function and then I sent it to client to fill the gridlist. can I use downloadFile function to do some task like that? if so how?
  21. function downloadMod() if not guiGetVisible(gWindow["DownloadMod"]) then showCursor(true) guiSetVisible(gWindow["DownloadMod"], true) guiGridListClear(gGrid["DownloadMod"]) triggerServerEvent('onLoadDownloadList', localPlayer, localPlayer) else showCursor(false) guiSetVisible(gWindow["DownloadMod"], false) end end bindKey("f4", "down", downloadMod) function fillDownloadList(downloadList) for _, data in pairs(downloadList) do local row = guiGridListAddRow(gGrid["DownloadMod"]) local modSize = data[3] + data[5] + data[7] local txd, dff, col = data[8], data[9], data[10] local txd_id, dff_id, col_id = data[11], data[12], data[13] if not txd then txd = '-' end if not dff then dff = '-' end if not col then col = '-' end if not txd_id then txd_id = '-' end if not dff_id then dff_id = '-' end if not col_id then col_id = '-' end guiGridListSetItemText(gGrid["DownloadMod"], row, gColumn["DownloadName"], data[1], false, false) guiGridListSetItemText(gGrid["DownloadMod"], row, gColumn["DownloadSize"], sizeFormat(modSize) or 0, false, false) guiGridListSetItemText(gGrid["DownloadMod"], row, gColumn["DownloadTXD"], txd, false, false) guiGridListSetItemText(gGrid["DownloadMod"], row, gColumn["DownloadDFF"], dff, false, false) guiGridListSetItemText(gGrid["DownloadMod"], row, gColumn["DownloadCOL"], col, false, false) guiGridListSetItemText(gGrid["DownloadMod"], row, gColumn["DownloadTXD_ID"], txd_id, false, false) guiGridListSetItemText(gGrid["DownloadMod"], row, gColumn["DownloadDFF_ID"], dff_id, false, false) guiGridListSetItemText(gGrid["DownloadMod"], row, gColumn["DownloadCOL_ID"], col_id, false, false) end end addEvent('onLoadDownloadDraw', true) addEventHandler('onLoadDownloadDraw', localPlayer, fillDownloadList) function onFillDownloadList(player) local downloadMods = {} for _, data in pairs(DownloadList) do local modName local txtID, dffID, colID local txdSize, dffSize, colSize local txdPath, dffPath, colPath local txdBytes, dffBytes, colBytes if (data.modName == nil) then modName = 'Unknown' else modName = data.modName end if (data.engineLoadTXD_Path == nil) then txdPath = false else txdID = data.engineImportTXD_ID txdPath = data.engineLoadTXD_Path end if (data.engineLoadDFF_Path == nil) then dffPath = false else dffID = data.engineReplaceModel_ID dffPath = data.engineLoadDFF_Path end if (data.engineLoadCOL_Path == nil) then colPath = false else colID = data.engineReplaceCOL_ID colPath = data.engineLoadCOL_Path end if(txdPath)then if fileExists(txdPath) then txdFile = fileOpen(txdPath) if(txdFile)then txdSize = fileGetSize(txdFile) txdBytes = fileRead(txdFile, fileGetSize(txdFile)) fileClose(txdFile) end end end if(dffPath)then if fileExists(dffPath) then dffFile = fileOpen(dffPath) if(dffFile)then dffSize = fileGetSize(dffFile) dffBytes = fileRead(dffFile, fileGetSize(dffFile)) fileClose(dffFile) end end end if(colPath)then if fileExists(colPath) then colFile = fileOpen(colPath) if(colFile)then colSize = fileGetSize(colFile) colBytes = fileRead(colFile, fileGetSize(colFile)) fileClose(colFile) end end end table.insert(downloadMods, {modName, txdBytes or false, txdSize or 0, dffBytes or false, dffSize or 0, colBytes or false, colSize or 0, txdPath or false, dffPath or false, colPath or false, txdID or false, dffID or false, colID or false}) end onClientSendMods(player, downloadMods) end addEvent('onLoadDownloadList', true) addEventHandler('onLoadDownloadList', root, onFillDownloadList) function onClientSendMods(player, downloadList) triggerLatentClientEvent(player, 'onLoadDownloadDraw', 50000, false, player, downloadList) end I tried this but it didnt work, didn't even send the list.
  22. Ohai People! I'm having a problem regarding this mod downloader. When I tried it in my local server the script is working fine, but after I ran it in my server, my server freezed and went down. It happened when two players open the panel at the same time or when there are many files. here's part when client receive the list. Client: Server: Thanks in advanced for the help.
  23. local marker = createMarker( 203.68948364258, 1913.0572509766, 17.640625, "Cylinder", 2, 6, 240, 226, 255) GUIEditor = { button = {}, window = {}, memo = {} } GUIEditor.window[1] = guiCreateWindow(428, 169, 485, 449, "Survivors", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible(GUIEditor.window[1], false) GUIEditor.button[1] = guiCreateButton(148, 307, 194, 57, "Choose", false, GUIEditor.window[1]) GUIEditor.memo[1] = guiCreateMemo(9, 24, 466, 247, "Survivors.... Allied With Military , if you choose this side , you will be spawned to the Military & Survivors Base. and there is no going back. and as a survivor , you will need to survive and explore san andreas while killing zombies and surviving for better experience.", false, GUIEditor.window[1]) guiMemoSetReadOnly(GUIEditor.memo[1], true) addEventHandler("onClientMarkerHit", marker, function(player) if (player == localPlayer) then guiSetVisible(GUIEditor.window[1], true) end end) Simple as that. You need an onClientMarkerHit event to trigger it, and then set visible of window.
  24. Oh thank you for your fast reply, I'm so grateful.
×
×
  • Create New...