Jump to content

Cadu12

Retired Staff
  • Posts

    827
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Cadu12

  1. SuN a.k.a. AcitanoX, you are fu.ck.ed up, you did stealer from SHC We are not going help with stealer Edit: He got my anti-afk Becuase we cant change password in my ftps
  2. I tinhk its funtion dxDrawColorText
  3. Right is fixed now, but left is bugged, here is image: http://img819.imageshack.us/g/mtascreen ... 82815.png/ here is code: local name = getPlayerName(player) local vehicleE = getPedOccupiedVehicle(player) local rx, ry, rz = getElementPosition ( vehicleE ) local cx, cy = getScreenFromWorldPosition(rx, ry, rz) local nameW = dxGetTextWidth(name, 2, "default") local nameH = dxGetFontHeight(2, "default") local nameX, nameY = cx-(nameW/2), cy-(nameH*2) if nametagscolored[player] == nil then name = string.format("#%02X%02X%02X", r, g, b) .. getPlayerName(player) vehicleE = getPedOccupiedVehicle(player) rx, ry, rz = getElementPosition ( vehicleE ) cx, cy = getScreenFromWorldPosition(rx, ry, rz) nameW = dxGetTextWidth(name, 2, "default") nameH = dxGetFontHeight(2, "default") nameX, nameY = cx-(nameW/2), cy-(nameH*2) dxDrawColorText( name, nameX, nameY, sx, sy, tocolor(r, g, b, 255), 2, "default", textscale*NAMETAG_TEXTSIZE) else dxDrawColorText( name, nameX, nameY, sx, sy, tocolor(r, g, b, 255), 2, "default", textscale*NAMETAG_TEXTSIZE) end
  4. No, if i remove hex colors, the nametag will be remove color
  5. I have 2 bugged If i have 2 colored it makes left If i dont have colored it makes right here is image: http://img593.imageshack.us/g/mtascreen ... 32140.png/ http://img21.imageshack.us/g/mtascreen2 ... 24847.png/ and here is code: function dxDrawColorText(str, ax, ay, bx, by, color, scale, font) local pat = "(.-)#(%x%x%x%x%x%x)" local s, e, cap, col = str:find(pat, 1) local last = 1 while s do if cap == "" and col then color = tocolor(tonumber("0x"..col:sub(1, 2)), tonumber("0x"..col:sub(3, 4)), tonumber("0x"..col:sub(5, 6)), 255) end if s ~= 1 or cap ~= "" then local w = dxGetTextWidth(cap, scale, font) dxDrawText(cap, ax+100, ay, ax + w, by, color, scale, font, "center", "bottom", false, false, false ) ax = ax + w color = tocolor(tonumber("0x"..col:sub(1, 2)), tonumber("0x"..col:sub(3, 4)), tonumber("0x"..col:sub(5, 6)), 255) end last = e + 1 s, e, cap, col = str:find(pat, last) end if last <= #str then cap = str:sub(last) local w = dxGetTextWidth(cap, scale, font) dxDrawText(cap, ax+100, ay, ax + w, by, color, scale, font, "center", "bottom", false, false, false ) end end local sx, sy = guiGetScreenSize() function drawPlayerTags() for i,v in ipairs(getElementsByType("player")) do if not v == getLocalPlayer() then local name = getPlayerName(v) local x, y, z = getCameraMatrix() local px,py = getScreenFromWorldPosition(x,y,z+0.3,0.06) local rx, ry, rz = getPedBonePosition(v, 3) local dist = getDistanceBetweenPoints3D(x, y, z, rx, ry, rz) if isLineOfSightClear(x, y, z, rx, ry, rz, true, false, false, true, false, false, false) and dist <= 45 then local r,g,b = getPlayerNametagColor(v) local cx, cy = getScreenFromWorldPosition(rx, ry, rz) if not cx or not cy then return end local nameW = dxGetTextWidth(name, 2, "default") local nameH = dxGetFontHeight(2, "default") local nameX, nameY = cx-(nameW/2), cy-(nameH*2) dxDrawColorText(name, nameX, nameY, sx, sy-300, tocolor(r, g, b, 255), 2, "default") end end end end addEventHandler("onClientRender",getRootElement(),drawPlayerTags)
  6. https://wiki.multitheftauto.com/wiki/Main_Page Find: "General Lua Help"
  7. Cadu12

    One question

    When? tomorrow? toady?
  8. Cadu12

    One question

    I saw your image, you can make 100% center like EPG and SHC I know its harder there is image: http://img848.imageshack.us/g/mtascreen ... 14202.jpg/
  9. Cadu12

    One question

    nametag.lua in race resource? I did, doesnt show name it no errors . . .
  10. Cadu12

    One question

    Doesnt works, but it is bugged on nametag... http://img16.imageshack.us/i/bugged2.png/
  11. Cadu12

    One question

    Put this function?
  12. Cadu12

    One question

    I can do it, but i dont knows how do it center We can make X and Y? edit: there is code: function dxDrawColorText(str, ax, ay, bx, by, color, scale, font) local pat = "(.-)#(%x%x%x%x%x%x)" local s, e, cap, col = str:find(pat, 1) local last = 1 while s do if cap == "" and col then color = tocolor(tonumber("0x"..col:sub(1, 2)), tonumber("0x"..col:sub(3, 4)), tonumber("0x"..col:sub(5, 6)), 255) end if s ~= 1 or cap ~= "" then local w = dxGetTextWidth(cap, scale, font) dxDrawText(cap, ax, ay, ax + w, by, color, scale, font, "center", "bottom", false, false, false ) ax = ax + w color = tocolor(tonumber("0x"..col:sub(1, 2)), tonumber("0x"..col:sub(3, 4)), tonumber("0x"..col:sub(5, 6)), 255) end last = e + 1 s, e, cap, col = str:find(pat, last) end if last <= #str then cap = str:sub(last) local w = dxGetTextWidth(cap, scale, font) dxDrawText(cap, ax, ay, ax + w, by, color, scale, font, "center", "bottom", false, false, false ) end end
  13. Cadu12

    One question

    Yes, im sure edit: If you have msn, please send me a PM?
  14. Cadu12

    One question

    But center doesnt works ;/
  15. Cadu12

    One question

    How to make dxDrawText with color, and center? I know, thats hard...
  16. Cadu12

    Minimap

    It works, i used setTimer, thank you for the helping.
  17. Cadu12

    Minimap

    Oh works it, but setBlipSize and setBlipColor doesnt work Edit: Fixed, thank you for helping
  18. Cadu12

    Minimap

    I have one problem, when map started and doesnt set to all players colors There is script: addEvent("onMapStarting", true) function MapStarted() for id, player in ipairs(getElementsByType("player")) do playerTeam = getPlayerTeam" class="kw2">getPlayerTeam(player) local attachedElements = getAttachedElements(player) if attachedElements and #attachedElements > 0 and playerTeam then for k,v in ipairs(attachedElements) do if getElementType(v) == "blip" then local r,g,b = getTeamColor(playerTeam) setBlipColor(v, r, g, b, 255) setBlipSize ( v, 4 ) -- THIS IS ONLY FOR TEST! end end end end end addEventHandler("onMapStarting", getRootElement(), MapStarted)
  19. Ewwww, ok, thanks you But EPG have with colors for rankingboard Edit: He is using dxText?
  20. It works, but rankingboard_clint.lua in race resource, it says PiG|#FF0000Cadu12 I wanted to be PiG|Cadu12 here code: function createShadowedLabelFromSpare(x, y, width, height, text, align) if #spareElems < 2 then if not donePrecreate then outputDebug( 'OPTIMIZATION', 'createShadowedLabel' ) end return createShadowedLabel(x, y, width, height, text, align) else local shadow = table.popLast( spareElems ) guiSetSize(shadow, width, height, false) guiSetText(shadow, text) --guiLabelSetColor(shadow, 255, 119, 0) --guiSetSize(shadow, 1, 1, true) guiSetPosition(shadow, x + 1, y + 1, false) guiSetVisible(shadow, true) local label = table.popLast( spareElems ) guiSetSize(label, width, height, false) guiLabelSetHexColor(label, text) guiSetText(label, string.gsub ( text, '#%x%x%x%x%x%x', '' )) --guiSetSize(label, 1, 1, true) guiSetPosition(label, x, y, false) guiSetVisible(label, true) if align then guiLabelSetHorizontalAlign(shadow, align) guiLabelSetHorizontalAlign(label, align) else guiLabelSetHorizontalAlign(shadow, 'left') guiLabelSetHorizontalAlign(label, 'left') end return label, shadow end end
  21. I do wanted how do it, please it? There no is wiki, forum searched
  22. Try open anti-open and unblock MTA SA and will be fine
×
×
  • Create New...