Search the Community

Showing results for tags 'fetchremote'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • 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

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me


Gang


Location


Occupation


Interests

Found 7 results

  1. 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( "http://5music.online/?song="..(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
  2. 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?
  3. 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 📉
  4. 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 ?
  5. Hey guys, is there any way to convert a YouTube link to MP3 using fetchRemote or any other way? Thanks
  6. 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 ( "http://domain.com/idk.php", 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:
  7. Всем привет, допустим есть элементы, которых не мало и они создаются до входа игроков на сервер. На них я заменяю текстуру (маловесную, около 30 кб). Которая подгружается и генерируется на Web-сервере. Понятное дело что заменять надо на Клиентской стороне, с помощью: dxSetShaderValue() и engineApplyShaderToWorldTexture() И вот, при тесте сервера, при онлайне выше 20 человек и кол-ва элементов около 50-100 с заменнённой текстурой, при входе игроков наблюдаются провисания ФПС и кружок подгрузки у Всех игроков на сервере, потому что при входе нового игрока я заного подгружаю все текстуры на эти элементы, с помощью: for _,v in pairs(getElementsByType("vehicle")) do Как решить эту проблему? Как закрепить текстуры в глобальном мире на серверной строне, если это возможно? Или подскажите аналогию пожалуйста, если знаете как это реализовать без подобных нерациональных нагрузок.