Overkillz

Members
  • Content Count

    517
  • Joined

  • Last visited

  • Days Won

    1

Overkillz last won the day on November 11 2019

Overkillz had the most liked content!

Community Reputation

35 Good

1 Follower

About Overkillz

  • Rank
    Playa Partner

Recent Profile Visitors

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

  1. @IIYAMA Thanks for your suggestion, but, Im not going to reach the effect that Im looking for cuz I think the effect will be notable and not fancy while reaching the corners and the effect im looking for is that a circle over draw the "Rounded rectangle" I think i have explained pretty bad so I just made a quicky image to take it as reference. As you can see, some parts of the circle already left the rectangle (It won't be visible). Otherwise, is there a way to load .svg on MTA ? Thanks in advance, best regards.
  2. Hello dear community, I would like to ask if there is a way to limit the draw size to a texture ? What do I mean, well, I have a texture (A rectangle with rounded corners) well, I want to create an animation. A circle that becomes to a rectangle with BORDER CORNERS I think I luckily did this script like 4 years ago, but no idea how I did it (I know trat it sounds absurd.) If im not wrong, I used a shader, and I think it was the HUD Mask Shader: http://nightly.mtasa.com/files/shaders/shader_hud_mask.zip I would like to get any tip or suggestion to start to code the animation, but Im fully stuck. All the prerequesites were made like creating the RT, restore in case of minimzeing ...etc Thanks for reading, best regards.
  3. Hello dear community, today I have a simple question. Is there a way to insert a table with dbExec ? I know I can use a loop and insert them one by one, but Im worried about the impact that it could cause. Thanks for reading, best regards.
  4. Well, you probably will need to use the following functions since you are going to connect your server to your web-server dbConnect() dbQuery() dbExec() In case that mybb uses a hash system to encrypt the account passwords (Highly posible) this method is not going to work for you unless you know which kind of encryption method uses. Best regards.
  5. Well, looks like creating renderTargets while you are minimized it fully bugs the renderTarget element. I just added some functions to avoid the creation of renderTargets while the players is minimized ...etc Also, while restoring, Im destroying the renderTarget element to create it again just to ensure that everything its ok. Just to clear one thin. I thought that using the argument (didClearRenderTargets) provided by onClientRestore would be usefull, but I really have just tested it and it didn't work for me, so, restoring wasnt working at all since this argument doesn't work properly. Take care about creating renderTarget while minimizeing (For example in a notification script that are using rts) Thanks for your help, best regards.
  6. @Bonsai First of all, thanks for answering. Well, creating renderTarget again might could cause the issue. About calling drawTopTime() iinside render function the CPU Usage fires depending of the amount inside the table. The reason why Im creating again the renderTarget is due to the size changes depending of the amount inside the table. I need to clear out that I've already tried to destroy the renderTarget element and setting the variable as nil. Any suggestions ? @IIYAMA I've just commented about what you told I had already tried to destroy the element in other scripts where Im using renderTargets with this method. Example of my scoreboard if isElement(scoreboardRT) then destroyElement(scoreboardRT) scoreboardRT = nil end scoreboardRT = dxCreateRenderTarget(sizeX,fullSizeY,true) --REST OF THE CODE Respecting the elementTree, thats took all my attention. Might using several renderTargets is causing the problem ? Im currently using like 3 or 4 renderTargets. race, scoreboard, toptimes and might another one. I need to clear out that only the scoreboard is having the destroyElement method and might the issue is caused by the rest of scripts that are NOT using the destroyElement method ? Thanks for answering, best regards.
  7. Hey there dear community, today Im having an issue with renderTargets as the title says. Well, In fact it happens me when I minimize (not all the times) I thought that using properly the function onClientRestore it would be solved and I wouldn't have any problem, but no. Well the problem is that the renderTarget is not drawn or dissapear when minimizeing and restoring. The code is too long and there are useless functions that are innecessary, so, here goes a simple version how am I using renderTargets. Im sure that it is the right way to use and restore it. NOTE: Variables are properly set. The script works perfectly, but sometimes dissapear while minimizeing and restoring local topTimelist = {} for i=1,8 do table.insert(topTimelist, {pos = i, playerName = "–– Empty", time = "", date = "", country = "", playerSerial = "" }) end function drawTopTime() sizeY = labelSize*(#topTimelist+1) toptimesRT = dxCreateRenderTarget(sizeX,sizeY,true) dxSetRenderTarget(toptimesRT, true) dxSetBlendMode("modulate_add") --DRAW CONTENT dxSetBlendMode("blend") dxSetRenderTarget() end function renderTopTime() dxDrawImageSection(x,y,sizeX,maxSizeY,0,slide,sizeX,maxSizeY,toptimesRT,0,0,0,tocolor(255,255,255,255)) end function restoreTopTimesDraw(didClearRenderTargets) if didClearRenderTargets then drawTopTime() end end addEventHandler("onClientRestore",root,restoreTopTimesDraw) drawTopTime() addEventHandler("onClientRender",root,renderTopTime)
  8. @Zango Thats it ! Well, I have the last question, how could I select the angle to start. For example, the angle starts at the red line, but I want that it starts at green line. I know that when I use the angle while drawing images or whatever i can use the angle argument, but, I just would like to know whats the right math application in this case Thanks for reading, best regards.
  9. Hello dear community, today Im having a math issue. Well, Im just trying to get the mouse angle with the center at the middle on the screen. The code is almost done, but it only works 180 degrees. It only detects the half part of the circle. top side with negatives value and top with positive values. I know I can use conditions to make it work with 360 degrees, however Im here to know if there is a way to get a perfect angle without appealing to conditions if isCursorShowing() then local px,py = getCursorPosition() local mx,my = sX*px,sY*py local distY = math.abs(my-centerY) local distX = math.abs(mx-centerX) local dist = math.sqrt((distY*distY)+(distX*distX)) local val = distY/dist local aSine = math.atan2(my-centerY,mx-centerX); local degrees = aSine*(180/piVariable) --Draw degrees ... end Missing variables are already defined. Just to clear it. Center variables are the middle of the screen. Thanks for reading, best regards.
  10. You dont need to use killTimer due to setTimer function already has an argument which allow you to execute the same function x times. myTimer = setTimer(function() outputChatBox("only one time") end, 1000, 1) --HERE IT IS, The las value '1' are the times that it is going to be executed. For future cases, if you want to use killTimer function, be aware that you have to check first if the timer exists using the function. isTimer() Regards.
  11. @IIYAMA It is something weird. Here it is the current full code. local sX,sY = guiGetScreenSize() local radarSize = sY*0.2 local posX,posY = sX*0.02, sY*0.93-radarSize local blipsize,lpsize,range = radarSize/22,radarSize/12,180 local centerleft,centertop = posX+radarSize/2,posY+radarSize/2 local lp = getLocalPlayer() local scaleValue = sY / (1080) scaleValue = math.max(scaleValue, 0.85) -- < IIYAMA's scale limit local fontList = { [9] = dxCreateFont( "files/font/globalFont.ttf", 9*scaleValue ), [10] = dxCreateFont( "files/font/globalFont.ttf", 10*scaleValue ), [11] = dxCreateFont( "files/font/globalFont.ttf", 11*scaleValue ), [12] = dxCreateFont( "files/font/globalFont.ttf", 12*scaleValue ), [16] = dxCreateFont( "files/font/globalFont.ttf", 16*scaleValue ), [18] = dxCreateFont( "files/font/globalFont.ttf", 18*scaleValue ), [20] = dxCreateFont( "files/font/globalFont.ttf", 20*scaleValue ), [22] = dxCreateFont( "files/font/globalFont.ttf", 22*scaleValue ), [24] = dxCreateFont( "files/font/globalFont.ttf", 24*scaleValue ) } local speedFontHeight = dxGetFontHeight(1,fontList[18]) local speedoSize = speedFontHeight*3 function drawRadar() --#EMPTY CIRCLE TEXTURE emptyCirclerTxt = dxCreateTexture("files/img/EmptyCircle_Thickness.png") --#GTA MAP PRE-REQUISITES gtaMapShader = dxCreateShader("files/shader/hud_mask.fx") gtaMapTexture = dxCreateTexture( "files/img/map.png") circleTxt = dxCreateTexture( "files/img/circle.png") if gtaMapShader and gtaMapTexture and circleTxt then outputDebugString("OK| creating the gtamap-prerequisites") dxSetShaderValue( gtaMapShader, "sPicTexture", gtaMapTexture ) dxSetShaderValue( gtaMapShader, "sMaskTexture", circleTxt ) end --#SPEEDOMETTER PRE-REQUISITES speedShader = dxCreateShader("files/shader/circle.fx") if emptyCirclerTxt then dxSetShaderValue(speedShader, "tex", emptyCirclerTxt) dxSetShaderTransform(speedShader,0,0,45) end addEventHandler("onClientRender",root,renderRadarContent) end function renderRadarContent() local px, py, pz = getElementPosition(lp) local pr = getPedRotation(lp) local cx, cy, _, tx, ty = getCameraMatrix() local north = findRotation(cx, cy, tx, ty) if gtaMapShader and gtaMapTexture and circleTxt then dxSetShaderValue( gtaMapShader, "gUVPosition", (px/6000),(py/-6000) ) dxSetShaderValue( gtaMapShader, "gUVScale", (1/13), (1/13) ) dxSetShaderValue( gtaMapShader, "gUVRotAngle", math.rad(-north) ) dxSetShaderValue( gtaMapShader, "gUVRotAngle", math.rad(-north) ) dxDrawImage(posX, posY, radarSize, radarSize, gtaMapShader, 0,0,0, tocolor(255,255,255,255) ) end dxDrawImage(sX/2,sY/2, speedoSize, speedoSize, speedShader,45,0,0,tocolor(0,255,0,255)) dxSetShaderValue(speedShader, "degree", (-1)*(1.5)) dxSetShaderValue( speedShader, "rgba", 0/255, 0/255, 0/255,0.5) end function findRotation(x1, y1, x2, y2) local t = -math.deg(math.atan2(x2 - x1, y2 - y1)) if t < 0 then t = t + 360 end return t end drawRadar() Look at the 64th line, The position should be near the bottom, but it is on the top due to dxSetShaderTransform. Any idea why it could be caused. ? Im not a shader knowledger but might the matrix of the shader or something like that. But it is weird, Im using 2 DIFFERENT SHADERS. Thanks and best regards.
  12. @IIYAMA Im not using renderTarget. Im just dealing with dxCreateTexture. Previously I tried it with renderTargets and I've got the same issue. Does dxSetShaderTransform use or must use renderTargets ? Thanks for answering, best regards.
  13. Hello dear community. Today I've decided to recode my Radar script using some public shaders from resource like "Hud mask". Well, the problem is that Im trying to use dxSetShaderTransform to flip the image and give it a negative increase value. But when I use this function, another shader that I've created is affected by this function. For example: I want to apply dxSetShaderTransform only to speedShader, but, gtaMapShader is affected to. Code function drawRadar() --#EMPTY CIRCLE TEXTURE emptyCirclerTxt = dxCreateTexture("files/img/EmptyCircle_Thickness.png") --#GTA MAP PRE-REQUISITES gtaMapShader = dxCreateShader("files/shader/hud_mask.fx") gtaMapTexture = dxCreateTexture( "files/img/map.png") circleTxt = dxCreateTexture( "files/img/circle.png") if gtaMapShader and gtaMapTexture and circleTxt then dxSetShaderValue( gtaMapShader, "sPicTexture", gtaMapTexture ) dxSetShaderValue( gtaMapShader, "sMaskTexture", circleTxt ) end --#SPEEDOMETTER PRE-REQUISITES speedShader = dxCreateShader("files/shader/circle.fx") if emptyCirclerTxt then dxSetShaderValue(speedShader, "tex", emptyCirclerTxt) dxSetShaderTransform(speedShader,180,0,45) end addEventHandler("onClientRender",root,renderRadarContent) end function renderRadarContent() local px, py, pz = getElementPosition(lp) local pr = getPedRotation(lp) local cx, cy, _, tx, ty = getCameraMatrix() local north = findRotation(cx, cy, tx, ty) if gtaMapShader and gtaMapTexture and circleTxt then dxSetShaderValue( gtaMapShader, "gUVPosition", (px/6000),(py/-6000) ) dxSetShaderValue( gtaMapShader, "gUVScale", (1/zoom), (1/zoom) ) dxSetShaderValue( gtaMapShader, "gUVRotAngle", math.rad(-north) ) dxSetShaderValue( gtaMapShader, "gUVRotAngle", math.rad(-north) ) dxDrawImage(posX, posY, radarSize, radarSize, gtaMapShader, 0,0,0, tocolor(255,255,255,255) ) end dxDrawImage(sX/2,sY/2, speedoSize, speedoSize, speedShader,45,0,0,tocolor(0,255,0,255)) dxSetShaderValue(speedShader, "degree", (-1)*(1.5)) dxSetShaderValue( speedShader, "rgba", 0/255, 0/255, 0/255,0.5) end I hope you can bring me a hand with this issue. Thanks in advance, regards.
  14. Looks like it is being updated many times in few seconds. Anyways. It shouldnt give you fps drops or something like that since it isnt in a render Event. Otherwise. I would update the system to be updated when a player needs it or reducing the timer that it probably has. Regards
  15. Try to use a simpler one texture ScreenTexture; technique tech { pass p0 { Texture[0] = ScreenTexture; } } Regards.