Search the Community

Showing results for tags 'fetchremote'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
  • Archive
  • Private Bugtracker

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



About Me





Found 8 results

  1. function myCallback(data, errno,path) if errno == 0 then triggerEvent("onFileTDownload", root, "sound.mp3", data); else outputChatBox ('Error '..errno) --it return error 7, when ip == localhost returns error 1006 end end addEvent("onFileTDownload", false); addEventHandler("onFileTDownload", root, function(path,data) local file; if not fileExists(path) then file = fileCreate(path); else file = fileOpen(path); end; fileWrite(file, data); fileClose(file); -- do whatever with the file ... end); function testdownload () fetchRemote("",myCallback, "", false,':testressource/sound.mp3'); --[[i tried the following two examples too... fetchRemote("http://localhost/testressource/sound.mp3",myCallback, "", false,':testressource/sound.mp3'); fetchRemote("http://localhost:80/testressource/sound.mp3",myCallback, "", false,':testressource/sound.mp3'); ]] end addCommandHandler ('tts',testdownload) --[[ All in the client side]] How to solve it? can someone help me pls
  2. How to improve the code so that it works quickly and without delay? This script works well when there are few players, but when more than 20 people come in, it starts to load for a long time. A very long time. It can load for hours. CLIENT ↓↓ triggerServerEvent("onSearchRequest",localPlayer, 'text_search') CLIENT ↑↑ SERVER ↓↓ addEvent("onSearchRequest", true) addEventHandler("onSearchRequest",getRootElement(),function(txt) fetchRemote( ""..(txt:gsub(' ', '+')),onSongReturn,'',true,client) end) function onSongReturn(data,errno,player) if player and isElement(player) then local str1 = string.find(data,"<ul>") local _,str2 = string.find(data,"</ul>") if str1 ~= nil then local data = string.sub(data,str1,str2) triggerClientEvent(player,"onSongReceived", player, data) end end end UPGRADE CODE PLEASE
  3. I know about socket module that can manage with it. Also i can output mta messages on discord server using web hook, but can i do it in opposite direction? I mean can i output discord messages on mta server without additional modules?
  4. Hi there! I've recently discovered 2 problems: 1. I can't trigger fetchRemote inside another fetchRemote function. Example: fetchRemote("http_stuff",function(resp) -- everything OK here -- some magic here myfunc("some_args") end) function myfunc(args) fetchRemote("httpStuff_x2",function(resp2) print("done x2") end) -- it won't trigger but i'll see 'done x2' message end 2. i can't store information into variables inside fetchRemote func. Example: local variable fetchRemote("http_stuff",function(resp) -- everything OK here variable = resp print(variable) -- OK end) print(variable) -- nil I don't know what to do 📉
  5. After some updates on the FetchRemote function, I'm having a lot of trouble downloading some files directly from a "Domain" Example: My server is on a Host, and the Files on another Host, and it looks like something is blocking and FetchRemote Function. can someone help me ?
  6. Hey guys, is there any way to convert a YouTube link to MP3 using fetchRemote or any other way? Thanks
  7. Hello everyone I am trying to send a image from MTA Server to my site, however, the file is always empty... I would like to ask a help to solve this. Thanks. Server.lua (MTA) function result(result,error) outputChatBox(tostring(result)) end addEventHandler( "onPlayerScreenShot", root, function ( theResource, status, pixels, timestamp, tag ) outputChatBox("take") callRemote ( "", result, pixels ) end ) function doTakeScreenShot() takePlayerScreenShot( getRandomPlayer(), 320, 200 ) end setTimer(doTakeScreenShot, 2000, 1) idk.php (Web) include( "mtaphpsdk_0.4/mta_sdk.php" ); $input = mta::getInput(); $myfile = fopen("newfile.jpeg", "w") or die("Unable to open file!"); fwrite($myfile, $input[0]); fclose($myfile); mta::doReturn(true); Result:
  8. Всем привет, допустим есть элементы, которых не мало и они создаются до входа игроков на сервер. На них я заменяю текстуру (маловесную, около 30 кб). Которая подгружается и генерируется на Web-сервере. Понятное дело что заменять надо на Клиентской стороне, с помощью: dxSetShaderValue() и engineApplyShaderToWorldTexture() И вот, при тесте сервера, при онлайне выше 20 человек и кол-ва элементов около 50-100 с заменнённой текстурой, при входе игроков наблюдаются провисания ФПС и кружок подгрузки у Всех игроков на сервере, потому что при входе нового игрока я заного подгружаю все текстуры на эти элементы, с помощью: for _,v in pairs(getElementsByType("vehicle")) do Как решить эту проблему? Как закрепить текстуры в глобальном мире на серверной строне, если это возможно? Или подскажите аналогию пожалуйста, если знаете как это реализовать без подобных нерациональных нагрузок.