Skraund

Members
  • Content Count

    31
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Skraund

  • Rank
    Rat
  • Birthday 01/01/2018

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Skraund

    [Questions]: Lua. Traffic. Java.

    Hello, I have a few questions: 1. Question about variables. Suppose I created a variable and put a floating point number in it, the system will automatically allocate under this memory. But if I later assign this variable a nil value or another type with a smaller memory size, then the system will re-allocate this variable new memory or leave the same amount? I ask it, because there is a desire to reduce the amount of memory on the client side, so I wonder if there is any sense assign unused variables to nil. 2. I have repeatedly stumbled upon a traffic system, as in a single game, but with a large number of characters, it begins to lag. And many users of such resources notice this. Question - What could be these lags? A large number of calculations? Can you somehow remove or minimize these lags without reducing the number of characters in traffic? 3. At the forum I came across several questions about writing a project in Java. And as far as I understand, this is possible only on the server side. The question is how to write the server part of the MTA server in Java? Java SDK? Sorry for my bad english.
  2. Skraund

    [Question]: Java SDK and Lua

    Ok. And from Lua, you can send data through Java SDK? For example, when a player joined the server.
  3. Skraund

    [Question]: Java SDK and Lua

    Hello, I did not understand a bit about Java SDK. Can it be used to retrieve data from a table in the lua resource for the MTA server?
  4. Skraund

    [HELP]: setElementRotation

    Большое спасибо, это то, что мне нужно, тема закрыта.
  5. Skraund

    [HELP]: setElementRotation

    Hello, I have a resource airbrake with this code: function putPlayerInPosition(timeslice) local cx,cy,cz,ctx,cty,ctz = getCameraMatrix() ctx,cty = ctx-cx,cty-cy timeslice = timeslice*0.1 if getKeyState("num_7") then timeslice = timeslice*4 end if getKeyState("num_9") then timeslice = timeslice*0.25 end local mult = timeslice/math.sqrt(ctx*ctx+cty*cty) ctx,cty = ctx*mult,cty*mult if getKeyState("w") then abx,aby = abx+ctx,aby+cty end if getKeyState("s") then abx,aby = abx-ctx,aby-cty end if getKeyState("d") then abx,aby = abx+cty,aby-ctx end if getKeyState("a") then abx,aby = abx-cty,aby+ctx end if getKeyState("space") then abz = abz+timeslice end if getKeyState("lshift") then abz = abz-timeslice end setElementPosition(localPlayer,abx,aby,abz) end function toggleAirBrake() air_brake = not air_brake or nil if air_brake then abx,aby,abz = getElementPosition(localPlayer) addEventHandler("onClientPreRender",root,putPlayerInPosition) else abx,aby,abz = nil removeEventHandler("onClientPreRender",root,putPlayerInPosition) end end bindKey("num_0","down",toggleAirBrake) But I do not know how to move the character to turn him in the direction where the camera is looking. Can someone help with this?
  6. Skraund

    [HELP]: setElementRotation

    При таком варианте по одной оси персонаж поворачивается лицом туда, куда смотрит камера, а по другой оси поворачивается в противоположную сторону. У меня есть airbrake и мне нужно, чтобы когда персонаж перемещался, он смотрел лицом туда, куда направлена камера. Вот код: function putPlayerInPosition(timeslice) local cx,cy,cz,ctx,cty,ctz = getCameraMatrix() ctx,cty = ctx-cx,cty-cy timeslice = timeslice*0.1 if getKeyState("num_7") then timeslice = timeslice*4 end if getKeyState("num_9") then timeslice = timeslice*0.25 end local mult = timeslice/math.sqrt(ctx*ctx+cty*cty) ctx,cty = ctx*mult,cty*mult if getKeyState("w") then abx,aby = abx+ctx,aby+cty end if getKeyState("s") then abx,aby = abx-ctx,aby-cty end if getKeyState("d") then abx,aby = abx+cty,aby-ctx end if getKeyState("a") then abx,aby = abx-cty,aby+ctx end if getKeyState("space") then abz = abz+timeslice end if getKeyState("lshift") then abz = abz-timeslice end setElementPosition(localPlayer,abx,aby,abz) end function toggleAirBrake() air_brake = not air_brake or nil if air_brake then abx,aby,abz = getElementPosition(localPlayer) addEventHandler("onClientPreRender",root,putPlayerInPosition) else abx,aby,abz = nil removeEventHandler("onClientPreRender",root,putPlayerInPosition) end end bindKey("num_0","down",toggleAirBrake)
  7. Здравствуйте, перейду сразу к делу. Я получаю координаты камеры игрока через getCameraMatrix() и затем я хочу повернуть его туда, куда смотрит камера, но у меня никак не получается это сделать. Кто знает, как нужно обработать данные полученные из getCameraMatrix(), чтобы их можно было ввести в setElementRotation и потом персонаж поворачивался в ту сторону, куда смотрит камера?
  8. Здравствуйте, можно ли как-то увидеть ник над своим персонажем? Просто хочу создать кастомный ник, но не знаю как его настраивать без других людей на сервере.
  9. Hello everyone, I decided to create my own custom nickname above the player, but there was some difficulty. How to make it so that you can see your nickname above the character? Sorry for my bad english
  10. Hello, I'm having a problem, I need to call a function in the browser from the lua script. But I can not do it at all. ----------------------------------------------------------------------------------------------------------------------------------------- HTML: <script> function chat() { var text = document.getElementById( "Text" ).value document.getElementById( "Text" ).value = "" } </script> LUA: executeBrowserJavascript( theBrowser, "?" ) ----------------------------------------------------------------------------------------------------------------------------------------- Someone can tell how to call a function in the browser from the lua script?
  11. Skraund

    [Help]: Custom chat

    Is it possible to draw 100 lines of text at the same time as the FPS is reduced by 4-5 units, and not by 20 units?
  12. Skraund

    [Help]: Custom chat

    Hello, I hid the standard chat and created a new chat. All works well, except for one, when drawing a single line, I draw the text 5 times, 1 time the color text, and 4 is the black text that is shifted along the OX and OY axes to make a stroke. But when 20 lines are drawn, the FPS is reduced by 20 units. Someone knows how to draw text with a stroke, but at the same time, the FPS does not fall much? P. S. I tried to draw the text through the CEF, the FPS did not fall, but there were strong delays while drawing the text, can someone know how to draw the text through the shaders? Sorry for my English.
  13. Skraund

    [Question]: SetElementData

    Hello, I would like to clarify something about this function. In its description it is said that it can heavily burden the system. Therefore, I want to ask people who understand this topic, to teach how to use it correctly. For example, if you store only a few characters for each of players, will this burden the system? Sorry for my bad english.
  14. Здравствуйте, может кто-то подсказать как сделать так, чтобы во время загрузки файлов сервера был не черный экран, а, например, вид на город LS?