Jump to content

JR10

Retired Staff
  • Posts

    2,947
  • Joined

  • Last visited

Everything posted by JR10

  1. I think you can't in any way using JS, since the local website can't access any remote source. A possible solution would be to use MTA to download the images needed and then edit the HTML document to load the image.
  2. You don't need to write JS code. Here's an example: local image_data fetchRemote('https://s.gravatar.com/avatar/0cb95b1047a5e33381d7cda457e57b51?s=80', function(err, data) if (err) then print(err) return end img_data = data end) addEventHandler('onPlayerJoin', root, function() triggerLatentClientEvent(source, 'downloadImage', resourceRoot, img_data) end) On the client, receive the image_data, create a texture and draw it. local image = dxCreateTexture(img_data)
  3. And XML is really bad for any server. SQL is not that hard to learn. Check the tutorial in my signature.
  4. Fetch it server-side, store it in a variable, and send it to the client with triggerLatentClientEvent whenever needed.
  5. Check the files' permissions, it's probably unreadable.
  6. JR10

    Map editor

    They can be cloned or removed, but they can not be selected.
  7. Don't use XML for an account system, that's very inefficient and will probably cause lag and eat so much CPU. Use SQL or the default accounts system.
  8. I think it doesn't support hex codes, you'll have to edit it yourself.
  9. I doubt that it is in any way accurate. Any issue can be moved to earlier or later versions.
  10. You can do an in-place upgrade by replacing the files. If it's on windows, simply running the installer would do. If this is on Linux, just replace the files with the newer ones.
  11. There are many ways to do this. Just google "export sqlite" and you will find plenty of hits.
  12. addEvent('onMapStarting') addEventHandler('onMapStarting', root, function() for index, vehicle in pairs(getElementsByType('vehicle')) do setElementModel(vehicle, 411) end end)
  13. Can you start the resource? What does it output when you start it?
  14. Can you start the resource? What is output when you execute 'refresh' in the console?
  15. Does it output any errors when you do /refresh or when you start the resource? Post your meta.xml.
  16. So you know how to write scripts yourself but you don't know how to copy ones from the forums? Just place them in an Lua file and add the file to the meta.xml.
  17. There are many ways to do this. Most simple is probably: dbQuery(callback, database, 'SELECT 1 FROM `table` WHERE ... LIMIT 1') function callback(qh) local result = dbPoll(qh, 0) if (#result > 0) -- it exists end end
  18. function unbind (hit) if hit == localPlayer then unbind("h","down",onhit) end end addEventHandler("onClientMarkerLeave",sf,unbind) You're calling the function itself again, only this time with different arguments so it will fail to continue because of the condition. function unbind (hit) if hit == localPlayer then unbindKey("h","down",onhit) end end addEventHandler("onClientMarkerLeave",sf,unbind)
  19. JR10

    Need RPG Script

    Either start learning or pay someone. This is not a forum for requests.
  20. You're triggering the client event with the table for each account. function gridlist(clan) theTable = {} for index, ac in pairs(getAccounts()) do local keyclan = getAccountData(ac,"ortakveri") if keyclan == clan then local nick = getAccountData(ac,"nick") table.insert(theTable, {nick}) end end triggerClientEvent(source,"gridlist",resourceRoot,theTable) end I doubt source is defined here, make sure it is. Also, you don't need to store each 'nick' in a table, since there are no other values added.
  21. The script nullifies the variable and then re-initializes it as an empty table right after getting it. local upgrades = getAccountData (getPlayerAccount (source), "funmodev2-carupg") if upgrades then for i,v in pairs (fromJSON(upgrades)) do addVehicleUpgrade (vehicle, v) end end You have commented the line that saves the vehicle's upgrades. Line 95 should not be commented.
  22. You should break after removing the player, so it doesn't uselessly loop through the rest of the table. setTimer ( function (player) for k,v in ipairs (players) do if (v == player) then table.remove (players, k) break end end triggerClientEvent ("handler", resourceRoot, players) end, 5000, 1, source )
  23. JR10

    Help Me.

    I can't see testa being called anywhere, can you explain a bit better?
  24. You can use the "onMapStarting" event to loop through the vehicles. addEvent('onMapStarting') addEventHandler('onMapStarting', root, function() for index, vehicle in pairs(getElementsByType('vehicle')) do setVehicleColor(vehicle, 255, 255, 255) end end)
  25. For what it's worth, it looks pretty cool.
×
×
  • Create New...