Jump to content

XaskeL

Members
  • Posts

    244
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by XaskeL

  1. XaskeL

    4k scale

    Hi! You don't need to scale the interface size for monitors larger than the one on which the layout was printed and designed. It's enough just to put everything in the center, some elements really need to be stretched to the whole screen (like the background). But this is rather an exception to the rule.
  2. Element.TriggerEvent = function ( self, sName, ... ) return triggerServerEvent( sName, self, ... ); end; localPlayer:TriggerEvent( "onPlayerCatchAdvertise", "goverment" ); Maybe it will work.
  3. This problem persists in any case, regardless of when to hide the wheel. A little earlier it was different. https://github.com/multitheftauto/mtasa-blue/issues/2624
  4. I already thought of something like that when I had to pull a car in a drift to a pole in GTA. Of the good options that come to mind / or now come to mind - is to divide the table into clusters, which will activate on colshape which for example a radius of 100 meters and in those 100 meters about 20 positions that you need to handle. Then you don't have to make a huge iteration over the whole table. I hope I explained clearly
  5. What about counting with the player's rotation?
  6. Use "pattach" or "bone_attach" ( by CrystalMV ) and attach new weapon model to hand
  7. You need to remove the required object identifiers from the table.
  8. Dropbox: https://www.dropbox.com/s/bgs8dt7z62ctmct/test_empty.zip?dl=0
  9. You can replace the standard model with a transparent mesh or apply a shader to the standard model
  10. If there was an IDE that would analyze all classes, tables, etc. for the presence of any functions and offer options for the code, that would be great. I once had thoughts of writing my own IDE similar to VisualStudio, with all the useful things from VS, but I feel that it is very difficult and does not make sense.
  11. XaskeL

    Playing with a controller

    https://wiki.multitheftauto.com/wiki/SetPedAnalogControlState
  12. I remember carefully studying your works. Unfortunately, the site was destroyed by time, but thanks to those people that with the help of the wayback machine they were able to return what was lost. I still keep many of your works on my HDD! Many of them are still useful today, even bone_attach was useful to the community until recently. I am grateful to you for that.
  13. try this without detachElements and setCameraMatrix setCameraTarget( localPlayer )
  14. attachElements( getCamera(), getPedOccupiedVehicle( localPlayer ), 0, -5, 1.5, -10, 0, 0 ); I think this is the result you want.
  15. local SHADER_CODE = [===[ float3 g_f3Color = (float3)0.0; struct PSInput { float4 Position : POSITION0; float2 TexCoord : TEXCOORD0; }; float4 PixelShaderFunction ( PSInput PS ) : COLOR0 { return float4( g_f3Color, 1.0 - PS.TexCoord.x ); }; technique { pass P0 { PixelShader = compile ps_2_a PixelShaderFunction(); } } ]===]; local _dxDrawRectangle = dxDrawRectangle; local g_pShader = dxCreateShader( SHADER_CODE ); function dxDrawRectangle( fX, fY, fWidth, fHeight, pColor, bPostGUI, bLerpAlpha ) if ( not bLerpAlpha ) then _dxDrawRectangle( fX, fY, fWidth, fHeight, pColor, bPostGUI ); else dxSetShaderValue( g_pShader, "g_f3Color", pColor ); dxDrawImage( fX, fY, fWidth, fHeight, g_pShader, 0, 0, 0, -1, bPostGUI ); end end; addEventHandler( "onClientRender", root, function ( ) dxDrawRectangle( 600, 400, 256, 256, { 0, 0, 0 }, false, true ); end ); Please put a reaction to the message, it is on the bottom right. Don't be indifferent.
  16. As soon as I get free from work, I will give a ready-made code.
  17. Try creating something like this in a shader (it's really easy) or make a similar background in Photoshop.
  18. I was able to get a quick acceleration of the helicopter to 180 km / h, and it seems to me that if the acceleration is increased strongly, it will damage the controllability and it will be necessary to make compensators for the rotational speed along the axes. https://wiki.multitheftauto.com/wiki/SetElementAngularVelocity
  19. -- Author: XaskeL -- Created 06/05/2021 -- https://forum.multitheftauto.com/topic/130202-question-dx-render-target-rounded-corners/ local SHADER_CODE = base64Decode( "AQn//gABAAAAAAAAAwAAAAEAAAAwAAAAAAAAAAAAAAAEAAAAAQAAAAAAgD8AAIA/AACAPwAAgD8GAAAAY29sb3IArAADAAAAAAAAAFwAAAAAAAAAAAAAAAEAAAABAAAAUrgePgcAAAByYWRpdXMAAAMAAAAAAAAAiAAAAAAAAAAAAAAAAQAAAAEAAAAK16M7CwAAAGJvcmRlclNvZnQAAAEAAAAAAAAAuAAAAAAAAAAAAAAAAQAAAAEAAAABAAAAEQAAAGNvbG9yT3ZlcndyaXR0ZW4AAAAAAQAAAA8AAAAEAAAAAAAAAAAAAAAAAAAAAwAAAFAwAAAMAAAAcm5kUmVjd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IAAAP+ACACqoQgAVaFYAAAEAQAIgAIAAIAFAP+gAQD/gAEAAAIAAASAAQAAoAIAAAMAAAeAAADkgQEA5IACAAADAQABgAAAAIAAAAChAgAAAwEAAYABAACABgAAoAQAAAQBAAGAAQAAgAMAAKEDAKqABQAAAwEAAYABAACABQD/oAIAAAMBAAKAAAAAgQIAAKBYAAAEAQABgAEAVYABAP+AAQAAgFoAAAQAAAKAAADpgAAA6YAIAFWgWAAABAAAAYAAAACAAAD/gAgA/6AHAAACAAACgAAAVYAGAAACAAACgAAAVYACAAADAAAEgAAAVYAAAAChAgAAAwAAAoAAAFWBAgAAoAIAAAMAAASAAACqgAYAAKAEAAAEAAAEgAAAqoADAAChAwCqgAUAAAMAAASAAACqgAUA/6BYAAAEAAACgAAAVYAFAP+gAACqgFgAAAQAABGAAAAAgAEAAIAAAFWABQAAAwAACIAAAACAAAD/kFgAAAQBAAeABwAAoQAA5JADAKqABQAAAwAAB4ABAOSABADkoAEAAAIACA+AAADkgP//AAA" ); local g_pShader = dxCreateShader( SHADER_CODE ); local _dxRenderTarget = dxDrawRectangle; local _tocolor = tocolor; local function dxDrawRectangle( fPosX, fPosY, fWidth, fHeight, vColor, bPostDraw, bRound, fRadius, fBorderSoft ) if ( not bRound ) then _dxRenderTarget( fPosX, fPosY, fWidth, fHeight, vColor, bPostDraw ); else if ( type ( vColor ) == "table" ) then dxSetShaderValue( g_pShader, "radius", fRadius ); dxSetShaderValue( g_pShader, "borderSoft", fBorderSoft ); dxSetShaderValue( g_pShader, "color", vColor ); dxDrawImage( fPosX, fPosY, fWidth, fHeight, g_pShader, 0, 0, 0, -1, bPostDraw ); end end end local function tocolor( iRed, iGreen, iBlue, iAlpha, bToShader ) if ( not bToShader ) then return _tocolor( iRed, iGreen, iBlue, iAlpha ); else return { iRed / 255, iGreen / 255, iBlue / 255, iAlpha / 255 }; end end; local RED = tocolor( 255, 0, 0, 255, true ); addEventHandler( "onClientRender", root, function ( ) dxDrawRectangle( 600, 600, 256, 256, RED, false, true, 0.2, 0.01 ); end ); I took the shader code from DGS and compiled it (for review, I hope thisdp won't mind). You don't have to drag around a huge number of files if you only need to draw the antialiased corners in dxDrawRectangle. Which you yourself can grab into the RenderTarget.
  20. Why not try giving some kind of speed boost with vehicle.velocity? Write to resource manifest: <oop>true</oop> -- Author: XaskeL -- Created 05/05/2021 -- https://forum.multitheftauto.com/topic/130200-speed-of-helicopters local CAircraftSpeed = { addEventHandler = addEventHandler; setTimer = setTimer; localPlayer = localPlayer; tostring = tostring; g_iInterval = 50; g_fMultVelocity = 0.44; g_fVelocityLimit = 200; _DEBUG = true; }; CAircraftSpeed.__index = CAircraftSpeed; setmetatable( CAircraftSpeed, { __index = _G; } ); setfenv( 1, CAircraftSpeed ); if ( _DEBUG ) then addEventHandler( "onClientRender", root, function ( ) local pVehicle = localPlayer.vehicle; if ( pVehicle ) then dxDrawText( tostring( pVehicle.velocity.length * 180 ) .. " km/h", 600, 600, 600, 600 ); end end ); end CAircraftSpeed.OnCheck = function ( ) local pVehicle = localPlayer.vehicle; if ( pVehicle and pVehicle.type == "Helicopter" ) then local vecVelocity = pVehicle.velocity; local fMultiplyOffset = ( 1.0 + g_fMultVelocity ); if ( vecVelocity.length * 180 < g_fVelocityLimit ) then pVehicle.velocity = Vector3( vecVelocity.x * fMultiplyOffset, vecVelocity.y * fMultiplyOffset, vecVelocity.z ); end end end; CAircraftSpeed.OnStart = function ( ) setTimer( OnCheck, g_iInterval, 0 ); end; addEventHandler( "onClientResourceStart", resourceRoot, OnStart );
  21. -- Author: XaskeL -- Created 04/05/2021 -- https://forum.multitheftauto.com/topic/130216-help-debug-settings-graphics local CGraphicsDebug = { addEventHandler = addEventHandler; dxDrawRectangle = dxDrawRectangle; dxDrawText = dxDrawText; setTimer = setTimer; engineGetVisibleTextureNames = engineGetVisibleTextureNames; localPlayer = localPlayer; guiGetScreenSize = guiGetScreenSize; resourceRoot = resourceRoot; root = root; g_bRenderInfo = false; g_iInterval = 2000; g_bOverlayDraw = true; BLACK = tocolor( 0, 0, 0, 255 ); WHITE = -1; }; CGraphicsDebug.__index = CGraphicsDebug; setmetatable( CGraphicsDebug, { __index = _G; } ); setfenv( 1, CGraphicsDebug ); local g_fScreenX, g_fScreenY = guiGetScreenSize( ); CGraphicsDebug.OnRender = function ( ) dxDrawRectangle( 0, 0, g_fScreenX, g_fScreenY, BLACK, g_bOverlayDraw ); dxDrawText( "Set debug settings to default", 0, 0, g_fScreenX, g_fScreenY, WHITE, 1.0, "bankgothic", "center", "center", false, false, g_bOverlayDraw ); end; CGraphicsDebug.OnCheck = function ( ) if ( #engineGetVisibleTextureNames( ) < 1 ) then if ( not g_bRenderInfo ) then addEventHandler( "onClientRender", root, OnRender ); g_bRenderInfo = true; return; end else if ( g_bRenderInfo ) then removeEventHandler( "onClientRender", root, OnRender ); g_bRenderInfo = false; return; end end end; CGraphicsDebug.OnStart = function ( ) setTimer( OnCheck, g_iInterval, 0 ); end; addEventHandler( "onClientResourceStart", resourceRoot, OnStart ); Code that is 100% functional and can be used in a client-side project.
  22. local scx, scy = guiGetScreenSize( ); addEventHandler( "onClientRender", root, function ( ) if ( #engineGetVisibleTextureNames( ) < 1 ) then dxDrawRectangle( 0, 0, scx, scy, tocolor( 0, 0, 0, 255 ), false ); end end ); in theory this should work
  23. texture texture0; float factor; sampler Sampler0 = sampler_state { Texture = (texture0); AddressU = MIRROR; AddressV = MIRROR; }; struct PSInput { float2 TexCoord : TEXCOORD0; }; float4 PixelShader_Background(PSInput PS) : COLOR0 { float4 sum = tex2D(Sampler0, PS.TexCoord); for (float i = 1; i < 3; i++) { sum += tex2D(Sampler0, float2(PS.TexCoord.x, PS.TexCoord.y + (i * factor))); sum += tex2D(Sampler0, float2(PS.TexCoord.x, PS.TexCoord.y - (i * factor))); sum += tex2D(Sampler0, float2(PS.TexCoord.x - (i * factor), PS.TexCoord.y)); sum += tex2D(Sampler0, float2(PS.TexCoord.x + (i * factor), PS.TexCoord.y)); } sum /= 9; sum.a = 1.0; float value = (sum.r + sum.g + sum.b) / 3; return float4(value, value, value, 1.0); } technique complercated { pass P0 { PixelShader = compile ps_2_0 PixelShader_Background(); } } Test it
×
×
  • Create New...