Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 30/01/18 in all areas

  1. So yeah, made a little script demonstration which could be very useful for the innovative server creators. If you're a Diablo (Dungeon Siege in my case) fan, you'll definitely love this. Know what? Give this post some feedback and I'll post it to the community with exports and custom events
    1 point
  2. function dxDrawBorderedText( text, x, y, w, h, color, scale, font, alignX, alignY, clip, wordBreak, postGUI ) dxDrawText ( text:gsub('#%x%x%x%x%x%x', ''), x, y + 1, w + 1 , h , tocolor ( 0, 0, 0, 220 ), scale, font, alignX, alignY, clip, wordBreak, false ) dxDrawText ( text, x, y, w, h, color, scale, font, alignX, alignY, clip, wordBreak, postGUI, true ) end function renderName() local pX, pY, pZ = getElementPosition(localPlayer) local wX, wY = getScreenFromWorldPosition(pX, pY, pZ+1) local playerNick = getPlayerName(localPlayer):gsub("#%x%x%x%x%x%x", "") dxDrawBorderedText(playerNick, wX, wY, wX, wY, tocolor(255, 255, 255, 255), 1, "default", "center", "top", false, false, false, true, false) end addEventHandler("onClientRender", root, renderName) This works totally fine for me.
    1 point
  3. Are you trying to achieve that colors are not shown in the nametag while it is above the player's head?
    1 point
  4. You can split the string with the basic Lua function, call string.sub(). If I were you, I store the colored name in an elementData, and if the localPlayer set able to see the colors, I used the strings from the elementData, otherway the strings from getPlayerName() function. And if there is a colorcoded nickname, you can use this: function removeHex( s ) return s:gsub( '#%x%x%x%x%x%x', '' ) or s end
    1 point
  5. I see... Then you need to split the characters which you want to be colored and go ahead with hexameter colors. For the nametag, you should do a trick with the getScreenFromWorldPosition() wich can help you to calculate screen position from World postion and make a feel that is in the 3D world, but actually, its not....
    1 point
  6. You can use Hexameter colorcodes in the string, for example: dxDrawBorderedText("#F44242@#FFFFFF"..getPlayerName(player), x - w / 2 + 35, y - h + 6, w, h, tocolor(255,255,255,255), scale, font, "left", "top", false, false, false, true, false) For the automatically change you can use a string variable to store the actually color code for the changing part: local colorcode = "#F44242" dxDrawBorderedText(colorcode.."@#FFFFFF"..getPlayerName(player), x - w / 2 + 35, y - h + 6, w, h, tocolor(255,255,255,255), scale, font, "left", "top", false, false, false, true, false) And by change the value of 'colorcode' variable, you can do, want you want...
    1 point
  7. يبي لك تنسقها ><"
    1 point
  8. onPlayerDamage, setElementAlpha, a timer with setElementPosition.
    1 point
  9. Can you give us your dxDrawBorderedText function?
    1 point
  10. Give me a second. Gonna check it on my server.
    1 point
  11. Change if stat > 1000 then to if stat > 100 then
    1 point
  12. Is your database actually mySQL or SQLLite? Because you state mysql both in your code and topic title, but your dbConnect call is for a SQLLite database.
    1 point
  13. Let me create one for you. Give me about 15-20 minutes.
    1 point
  14. map = { size = 1024 } function reCalculateToMap (posX, posY) return posX / map["size"] * 6000 - 3000, posY / map["size"] * -6000 + 3000 end local x, y = reCalculateToMap (500, 800) print(x, y) function reCalculateFromMap (mapX, mapY) return (mapX + 3000) * map["size"] / 6000, (mapY - 3000) * map["size"] / -6000 end local x2, y2 = reCalculateFromMap (x, y) print(x2, y2) This is just old school math. Example: Click X position in image is: 240px Image size is: 1024px Map size is: 6000 X 240 / 1024 = 0.234375 --[[ 0.234375 * 100 = 23.4 240 is 23.4% from 1024 ]] 0.234375 * 6000 = 1406.25 --[[ Append to other value ETC. ]]
    1 point
  15. Using this technic the other way. Getting the screen position from the world position, and drawing it. If you don't try it at all, we ain't gonna give you an example.
    1 point
  16. جهازك مضروب 32 و كرت 128 ><
    1 point
  17. والله يا العقرب يوجد حلين اما تقلل الريزليوشن حق الشاشة ( تصغر حجم الشاشة العرض الخاصة باللعبة )ا او تروح تلعب كونتر سترايك ضض امزح Paladins العب لعبة ممتازة جداً ض
    1 point
  18. 1 point
  19. انا اعشق لعبه sims ما تحتاج مواصفات عاليه وهذي فخمه بعد لكن تحتاج رام 8 جيجا
    1 point
  20. Вот полный список что нужно изучить в MTA, это и языки программирования и софт. Вам придется это изучить если вы хотите делать проекты любого уровня и возможностей, либо помогать MTA. Разработка игровых режимов Lua - https://forum.multitheftauto.com/topic/27040-русские-доки-мануалы-туториалы-по-lua-и-mtasa/ База данных MySQL - Если хотите сохранять удаленно/локально, очень популярна для больших проектов в MTA. SQLite - MTA Использует по умолчанию для локальной базы, также есть множество функции, которые работают с ней (Account функции). Чаще используют мелкие проекты. Язык структурированных запросов SQL Шейдеры: HLSL - https://wiki.multitheftauto.com/wiki/Element/Shader Остальное: XML - MTA использует такой формат данных в конфигах JSON - Обработка ответа от веб запроса Создание UI используя CEF. HTML CSS Javascript CEF - https://wiki.multitheftauto.com/wiki/CEF_Tutorial Модули/Патчи/Разработка MTA C++ - В основном вся MTA, модули и некоторые библиотеки. C - Используется в библиотеках Модули - https://wiki.multitheftauto.com/wiki/Modules Visual Studio - Разработчики MTA используют именно её. Система контроля версий Git Реверс Assembler IDA Pro - Программа для дизассемблирования CheatEngine - Нахождение адресов памяти Стиль написания кода MTA: https://wiki.multitheftauto.com/wiki/Coding_guidelines Стиль написания кода для игрового мода: https://forum.multitheftauto.com/topic/34355-как-лучше-всего-выложить-код/
    1 point
  21. https://wiki.multitheftauto.com/wiki/OnClientClick string button, string state, int absoluteX, int absoluteY, float worldX, float worldY, float worldZ, element clickedWorld float worldX, float worldY, float worldZ, element clickedWorld https://wiki.multitheftauto.com/wiki/GetScreenFromWorldPosition float float getScreenFromWorldPosition ( float x, float y, float z, [ float edgeTolerance=0, bool relative=true ] )
    0 points
×
×
  • Create New...