• Announcements

    • jhxp

      Forums are online again after a maintenance.   18/03/17

      MTA Forums maintenance is completed, although some automatic time-heavy tasks are still in process and will be finished eventually in background. Expect some features such as Forum Search to not display all results until all processes are finished. Please let us know if you spot a forum feature that worked correctly before the maintenance but does not work anymore now. Thanks. --MTA Team

Simple01

Members
  • Content count

    1,069
  • Joined

  • Last visited

  • Days Won

    1

Simple01 last won the day on November 14 2016

Simple01 had the most liked content!

Community Reputation

104 Excellent

About Simple01

  • Rank
    Hard-@ss
  • Birthday 21/02/01

Details

  • Gang
    Simple MC
  • Location
    127.0.0.1
  • Occupation
    Programmer
  • Interests
    Programming

Recent Profile Visitors

1,886 profile views
  1. It's not strange, it's normal. don't try to use values bigger than your height or width because that would make a full circle.
  2. I want to watch UEFA Champions League online for free. Any recommendation?
  3. There's no default events or functions that get done those kinds of things, so better make your own dxLib with different themes which could be stored into a table or XML and accessed when its needed to modify the active theme.
  4. MTA no está muriendo, vamos que ni de coña. Cada vez hay más jugadores, otra cosa que la inovación falte.
  5. Imaginate un circulo, y luego un cuadrado con bordes redondeados. Y ya esta. :v
  6. Hello everyone, nothing to say so. LUA: function dxDrawCircle( x, y, width, height, color, angleStart, angleSweep, borderWidth ) height = height or width color = color or tocolor(255,255,255) borderWidth = borderWidth or 1e9 angleStart = angleStart or 0 angleSweep = angleSweep or 360 - angleStart if ( angleSweep < 360 ) then angleEnd = math.fmod( angleStart + angleSweep, 360 ) + 0 else angleStart = 0 angleEnd = 360 end x = x - width / 2 y = y - height / 2 if not circleShader then circleShader = dxCreateShader ( "circle.fx" ) end dxSetShaderValue ( circleShader, "sCircleWidthInPixel", width ); dxSetShaderValue ( circleShader, "sCircleHeightInPixel", height ); dxSetShaderValue ( circleShader, "sBorderWidthInPixel", borderWidth ); dxSetShaderValue ( circleShader, "sAngleStart", math.rad( angleStart ) - math.pi ); dxSetShaderValue ( circleShader, "sAngleEnd", math.rad( angleEnd ) - math.pi ); dxDrawImage( x, y, width, height, circleShader, 0, 0, 0, color, true ) end function dxDrawRoundedRectangle( x, y, width, height, radius, color ) if ( radius >= width ) or ( radius >= height ) then dxDrawCircle( x - ( radius / 2 ), y - ( radius / 2 ) ) end -- The radius is relative to the height and width of the rectangle, so to avoid rectangles if the radius is bigger than the width or height then a complete circle is being drawn. dxDrawCircle( x + ( radius / 2 ), y + ( radius / 2 ), radius, radius, color, 270, 90 ) dxDrawCircle( x + ( radius / 2 ), ( y + height ) - ( radius / 2 ), radius, radius, color, 180, 90 ) dxDrawCircle( ( x + width ) - ( radius / 2 ), y + ( radius / 2 ), radius, radius, color, 0, 90 ) dxDrawCircle( ( x + width ) - ( radius / 2 ), ( y + height ) - ( radius / 2 ), radius, radius, color, 90, 90 ) dxDrawRectangle( x, y + ( radius / 2 ), width, ( height ) - ( radius ), color, true ) dxDrawRectangle( x + ( radius / 2 ), y , ( width ) - ( radius ), ( radius / 2 ), color, true ) dxDrawRectangle( x + ( radius / 2 ), ( y + height ) - ( radius / 2 ), ( width ) - ( radius ), ( radius / 2 ), color, true ) end CIRCLE.FX ( The one from the MTA Wiki ) float sCircleHeightInPixel = 100; float sCircleWidthInPixel = 100; float sBorderWidthInPixel = 10; float sAngleStart = -3.14; float sAngleEnd = 3.14; //------------------------------------------------------------------------------------------ // PixelShaderFunction // 1. Read from PS structure // 2. Process // 3. Return pixel color //------------------------------------------------------------------------------------------ float4 PixelShaderFunction(float4 Diffuse : COLOR0, float2 TexCoord : TEXCOORD0) : COLOR0 { float2 uv = float2( TexCoord.x, TexCoord.y ) - float2( 0.5, 0.5 ); // Clip unwanted pixels from partial pie float angle = atan2( -uv.x, uv.y ); // -PI to +PI if ( sAngleStart > sAngleEnd ) { if ( angle < sAngleStart && angle > sAngleEnd ) return 0; } else { if ( angle < sAngleStart || angle > sAngleEnd ) return 0; } // Calc border width to use float2 vec = normalize( uv ); float CircleRadiusInPixel = lerp( sCircleWidthInPixel, sCircleHeightInPixel, vec.y * vec.y ); float borderWidth = sBorderWidthInPixel / CircleRadiusInPixel; // Check if pixel is inside circle float dist = sqrt( dot( uv, uv ) ); if ( ( dist > 0.5 ) || ( dist < 0.5 - borderWidth ) ) return 0; else return Diffuse; } //------------------------------------------------------------------------------------------ // Techniques //------------------------------------------------------------------------------------------ technique tec0 { pass P0 { PixelShader = compile ps_2_0 PixelShaderFunction(); } }
  7. Buenas a todos, nada que decir así que dejo esto por aquí. LUA: function dxDrawCircle( x, y, width, height, color, angleStart, angleSweep, borderWidth ) height = height or width color = color or tocolor(255,255,255) borderWidth = borderWidth or 1e9 angleStart = angleStart or 0 angleSweep = angleSweep or 360 - angleStart if ( angleSweep < 360 ) then angleEnd = math.fmod( angleStart + angleSweep, 360 ) + 0 else angleStart = 0 angleEnd = 360 end x = x - width / 2 y = y - height / 2 if not circleShader then circleShader = dxCreateShader ( "circle.fx" ) end dxSetShaderValue ( circleShader, "sCircleWidthInPixel", width ); dxSetShaderValue ( circleShader, "sCircleHeightInPixel", height ); dxSetShaderValue ( circleShader, "sBorderWidthInPixel", borderWidth ); dxSetShaderValue ( circleShader, "sAngleStart", math.rad( angleStart ) - math.pi ); dxSetShaderValue ( circleShader, "sAngleEnd", math.rad( angleEnd ) - math.pi ); dxDrawImage( x, y, width, height, circleShader, 0, 0, 0, color, true ) end function dxDrawRoundedRectangle( x, y, width, height, radius, color ) if ( radius >= width ) or ( radius >= height ) then dxDrawCircle( x - ( radius / 2 ), y - ( radius / 2 ) ) end -- El radius es relativo al tamaño del rectángulo, para evitar 'bugs' se dibuja el circulo completo. dxDrawCircle( x + ( radius / 2 ), y + ( radius / 2 ), radius, radius, color, 270, 90 ) dxDrawCircle( x + ( radius / 2 ), ( y + height ) - ( radius / 2 ), radius, radius, color, 180, 90 ) dxDrawCircle( ( x + width ) - ( radius / 2 ), y + ( radius / 2 ), radius, radius, color, 0, 90 ) dxDrawCircle( ( x + width ) - ( radius / 2 ), ( y + height ) - ( radius / 2 ), radius, radius, color, 90, 90 ) dxDrawRectangle( x, y + ( radius / 2 ), width, ( height ) - ( radius ), color, true ) dxDrawRectangle( x + ( radius / 2 ), y , ( width ) - ( radius ), ( radius / 2 ), color, true ) dxDrawRectangle( x + ( radius / 2 ), ( y + height ) - ( radius / 2 ), ( width ) - ( radius ), ( radius / 2 ), color, true ) end CIRCLE.FX: float sCircleHeightInPixel = 100; float sCircleWidthInPixel = 100; float sBorderWidthInPixel = 10; float sAngleStart = -3.14; float sAngleEnd = 3.14; float4 PixelShaderFunction(float4 Diffuse : COLOR0, float2 TexCoord : TEXCOORD0) : COLOR0 { float2 uv = float2( TexCoord.x, TexCoord.y ) - float2( 0.5, 0.5 ); float angle = atan2( -uv.x, uv.y ); // -PI to +PI if ( sAngleStart > sAngleEnd ) { if ( angle < sAngleStart && angle > sAngleEnd ) return 0; } else { if ( angle < sAngleStart || angle > sAngleEnd ) return 0; } // Calc border width to use float2 vec = normalize( uv ); float CircleRadiusInPixel = lerp( sCircleWidthInPixel, sCircleHeightInPixel, vec.y * vec.y ); float borderWidth = sBorderWidthInPixel / CircleRadiusInPixel; // Check if pixel is inside circle float dist = sqrt( dot( uv, uv ) ); if ( ( dist > 0.5 ) || ( dist < 0.5 - borderWidth ) ) return 0; else return Diffuse; } technique tec0 { pass P0 { PixelShader = compile ps_2_0 PixelShaderFunction(); } } ( El shader publicado es uno de los shaders de ejemplo que hay en la wiki de MTA )
  8. You could use this. local total_km, partial_km, tick_km = 0, 0, 0 function handleSpeed() if ( getPedOccupiedVehicle( localPlayer ) and getVehicleOccupant( getPedOccupiedVehicle( localPlayer ), 0 ) == localPlayer ) then local theVehicle = getPedOccupiedVehicle( localPlayer ) if ( tick_km <= 0 ) and ( getVehicleEngineState( vehicle ) ) then tick_km = getTickCount() end if ( getTickCount() - tick_km >= 1000 ) then local sx, sy, sz = getElementVelocity ( theVehicle ) local kms = ( ( ( sx * sx ) + ( sy * sy ) + ( sz * sz ) ) ^ ( 0.5 ) ) * 1000 / 3600 -- This would be the most realistic way but it add's up very fastly so better up the number that is dividing. if ( partial_km + kms >= 1 ) then partial_km = ( partial_km + kms ) - 1 total_km = total_km + 1 else partial_km = partial_km + kms end tick_km = getTickCount() end end end addEventHandler( "onClientRender", root, handleSpeed )
  9. El GUIEDITOR de por si ya trae esta función que es igual vamos... Pero igual, gracias por aportar tus conocimientos a la comunidad.
  10. Try this: (WXYZ) ( 0.5213, -0.47775, 0.70385, -0.06779 )
  11. These are rotation angles, make sure the rotation order is "ZYX" and not "ZXY" because the second one is the default for objects, but the one that the converters use is the first one "ZYX".
  12. function showPanel(thePlayer) accountname = getAccountName(getPlayerAccount(thePlayer)) if isObjectInACLGroup("user." .. accountname, aclGetGroup("Admin")) then local account = getPlayerAccount( thePlayer ) local tick = getAccountData( account, "panel_tick" ) or 0 if ( ( getTickCount() - tick ) >= 7200000 ) then setAccountData( account, "panel_tick", getTickCount() ) triggerClientEvent(thePlayer, "abrirVip", getRootElement()) end end end Replace your showPanel function with this one and done.
  13. Just search in google for quaternion euler converter online. Theres a simple website which allows you to make the conversion. And there q1 is the W and then q2 X etc.
  14. MTA Team said that they're not going to make stuff in the benefit of Rockstar Games anymore. So don't expect any other MTA release for other games of Rockstar Games.