Jump to content

Turbesz

Members
  • Posts

    245
  • Joined

  • Last visited

Everything posted by Turbesz

  1. edit: i reinstalled mta client, but the problem was not solved
  2. I don't understand why, but if i restart my script which contain a custom font, then the script show nonsense word instead of specified... Just a complete MTA restart fix it. I'm talking about this problem: Normally: After i restarted the script: No, I didn't change anything in the script, and the font added to meta. This is the code: local Roboto = dxCreateFont("Roboto.ttf",10) local RobotoL = dxCreateFont("RobotoL.ttf",11) dxDrawText("Kereszt #1", sx/2-65-10,sy/2-55/2+2, 0, sy/2-515/2+2+36, tocolor(255,255,255,255), 1, Roboto, "left", "center",false,false,false,true) dxDrawText("Ár: 50.000 Ft", sx/2-65-10,sy/2+25/2+2, 0, sy/2-515/2+2+36, tocolor(255,255,255,255), 1, RobotoL, "left", "center",false,false,false,true) Wth?!
  3. Meanwhile i realized how to use it, so now works properly
  4. i tried to use that function but i dont understand the logic, as well as in dxDrawMaterialLine3D for the same reason... when i draw the image on the ground, i cannot rotate that, because if i set the rot then the image goes up the sky from the ground... I want to rotate image clockwise/counterclockwise on the ground
  5. Then what can i do? How to rotate image?
  6. I tried many ways, but did not work, sadly.. (i know, the last 3 xyz value is for rotation, but no...) So with a simple dxDrawImage this not possible somehow?
  7. I want to draw a image on the ground where to park a vehicle, but i dont know how to make this possible... I tried: dxDrawMaterialLine3D (not a good solution, because i cannot rotate the image), and dxDrawImage3D (same problem...). Then how can i do this?
  8. turn off the windows firewall fully, then try again open the ports
  9. I want to draw blips on radar with render target, but blips are does not appears, and the arrow blip with render target appears outside of the radar.. I want to show all blips with rendertarget, and like map image, the blips comes out from radar frame, when we are approaching to blip position (that's why it should be use dxSetRenderTarget). But does not work. the code: --render target: rt = dxCreateRenderTarget(200, 400, true) --draw dxSetRenderTarget(renderImage,true) dxDrawRectangle(0,0,size2,size2,tocolor(88, 108, 137,255)) dxDrawImageSection(scx,scy,scw,sch,mx,my,mw,mh,texture,0,0,0,tocolor(255,255,255,255)) dxSetRenderTarget(newtarg,true) dxDrawImage(size/2,size/2,size2,size2,renderImage,rot,0,0,tocolor(255,255,255,255),false) for _,v in ipairs(blipimages) do dxSetRenderTarget(rt,true) local bx, by = size*1.5+v[1]-x,size*1.5+v[2]-y local alpha = 255 dxDrawImage(bx,by,v[3],v[4],v[5],v[6],0,0,tocolor(255,255,255,255),false) dxSetRenderTarget() dxDrawImage(radarPos[1]-7, radarPos[2]+19, 200, 400,rt, 0, 0, 0, tocolor(255,255,255,200)) end dxDrawImage(size*1.5-(blipDimension*0.75)/2,size*1.5-(blipDimension*0.75)/2,23,23,"files/arrow.png",rot-prz,0,0,tocolor(172,211,115,255),false) dxSetRenderTarget() blipimages={}
  10. I want to create a top kills script, but i dont understand how can i get the largest data to the smallest. I save the players kill to their account with setAccountData-getAccountData. can anyone explain how to do this?
  11. I want to spawn a bot, and when the player enter in the colshape then bot attack player, when the player leave the colshape then the bot stop attack, and follow. I use for this the slothbot script. Buut, when i spawn the bot, the bot automatically start follow and attack me, not dealing with the colshape events... Does not matter i enter or leave the colshape, the code does not work, only the spawn part... No any error and warning in debugscript... What wrong in my code? local zzone = createColCuboid(-78.946533203125, 1462.0727539063, 11.346961021423, 151.5, 124, 19) function lerakja() bot = exports.v5_slothbot:spawnBot(-8.23485, 1520.40417, 12.75000, 0, 23,0,0,_,0,"waiting",nil) end addCommandHandler("teszt",lerakja) function attack() exports.v5_slothbot:setBotFollow(bot, source ) exports.v5_slothbot:setBotAttackEnabled(true) end addEventHandler( "onElementColShapeHit", zzone, attack ) function stopattack() exports.v5_slothbot:setBotWait(bot) end addEventHandler( "onElementColShapeLeave", zzone, stopattack )
  12. i place it the text in the rectangle on 1920x1080 resolution so far so good, but when i change resolution to 1366x768 the rectangle is in the good place, but the text moves away from rectangle (not with cursor move) with this code: dxDrawText(math.round(getElementHealth(localPlayer)).."%",(hudX-415) * 2, (hudY-20) * 2, 1130 * xm, 75 * ym, tocolor(255,255,255,255),1.10*xm, 1.10*ym,"default-bold","center","center",_,_,_,true)
  13. the rectangles, and images does not move, only the text
  14. oh now i realized, how to add more rectangles, and images to this. but if i add a text, the text will move left / right on different resolutions... why? dxDrawText(math.round(getElementHealth(localPlayer)).."%",(hudX-415) * 2, (hudY-20) * 2, 1130 * xm, 75 * ym, tocolor(255,255,255,255),1.10*xm, 1.10*ym,"default-bold","center","center",_,_,_,true)
  15. oh thanks! btw how can i add to this more rectangles, texts, etc..?
  16. I tried to change sx__, and sy__ to xm, ym in onClientCursorMove event, but does not doesn't do anything that way too What example do you think?
  17. they are needed for positioning, example: dxDrawRectangle((sx_-245) * xm, (sy_/2-460) * ym, 220 * xm, 10 * ym,tocolor(0,0,0,120))
  18. I tried make movable a dx element and succeeded, then i tried in my hud script, and does not work with same method this is the calculation in my code: local sx_, sy_ = 1920, 1080 local sx__, sy__ = guiGetScreenSize() local xm, ym = sx__/sx_, sy__/sy_ addEventHandler( "onClientCursorMove", getRootElement( ), function ( x2, y2, xs, ys ) if isCursorShowing() then sx__, sy__ = xs, ys end end ) The hud elements does not move anywhere when i move the cursor. Why?
  19. I want to make my "non-movable" HUD to movable, but i dont understand how can i do it... Anyone can help me in this, what do i need for this, etc.?
  20. local startTime = getTickCount() function ColorMarker() for _,v in pairs(getElementsByType("marker", root, true)) do if getElementData(v,"rgb") == true and isElementOnScreen(v) then local progress = math.fmod(getTickCount() - startTime, 10000) / 10000 local length = interpolateBetween(400, 0, 0, 700, 0, 0, progress, "Linear") local r, g, b = wavelengthToRGBA(length) setMarkerColor(v, r, g, b, 100) end end end addEventHandler("onClientPreRender", getRootElement(), ColorMarker) if i remove that argument, the script works fine. but i think without that can cause lag with many players. there is no errors and warnings in debugscript, then what wrong?
  21. thank you very much for all the help, and your patience at least I just learned something new
×
×
  • Create New...