Jump to content

50p

Retired Staff
  • Posts

    2,973
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by 50p

  1. The model of the wheel has applied car colour material to it and that's how it works. This is simple if you understand GTA materials and know how to export models from 3DS Max. I have never tried this myself but that's how it works. That's also how multi colour cars work, some parts of the model have different car colour materials applied to them, eg. Banshee, NRG-500, etc. Therefore, you could possibly export wheel models with secondary car colour material applied and have vehicle 1 colour and wheels another colour.
  2. Unfortunaly, it doesn't work for me! Because it's client-side.
  3. What's getProgress function?
  4. Then getProgress returns 1.0.
  5. What do you mean it doesn't animate? Does it still "open" or not? To me it looks like messed up coords.
  6. You're applying the shader to texture "all" but you have to apply it to the fire texture. Use shader_texture_names resource to find names of the fire textures and then apply your shader to the fire texture. Since fire particles are animated (multiple textures get changed to create animation) you will have to do the same thing to all other fire textures as well.
  7. You can create GUI image (1x1 transparent image) or a label without text and then another image of the texture (the green stripes) but set its parent to the transparent image or a label. Then you need to animate the background, to do that, I'd create 2 background images snapped to each other and then move then in 1 direction (left or right). When one image gets to the end then move it to the other side of its neighbor and keep them moving. Once it's all working, extend the size of the parent (label or transparent image).
  8. https://wiki.multitheftauto.com/wiki/Se ... RotorSpeed
  9. radius is a parameter. You have to pass it when you call the function to determine how big the circle should be. Segments, color and width params are optional.
  10. Or create a marker and set it's alpha to 0.
  11. Here is a function for you. Drawing circles in 3D world. function dxDrawCircle3D( x, y, z, radius, segments, color, width ) segments = segments or 16; -- circle is divided into segments -> higher number = smoother circle = more calculations color = color or tocolor( 255, 255, 0 ); width = width or 1; local segAngle = 360 / segments; local fX, fY, tX, tY; -- drawing line: from - to for i = 1, segments do fX = x + math.cos( math.rad( segAngle * i ) ) * radius; fY = y + math.sin( math.rad( segAngle * i ) ) * radius; tX = x + math.cos( math.rad( segAngle * (i+1) ) ) * radius; tY = y + math.sin( math.rad( segAngle * (i+1) ) ) * radius; dxDrawLine3D( fX, fY, z, tX, tY, z, color, width ); end end You can modify it to draw what you're showing on the picture easily. Haven't tested but I can't see any errors so it should work.
  12. There is too much arguing going on. I am forced to lock the topic. @Deepu, If you think you'll get anyone buying your scripts by offending them then I must tell you that you're wrong. If you want customers, be nice to them. Good luck with your attitude. I'm not getting involved, topic locked.
  13. Rockstart baked the textures. That is, they don't use materials combined of 2 textures, they use simple textures that are blended together instead of blending them with shaders therefore KAMs scripts don't have any blending options.
  14. 50p

    its possible ?

    Yes. You would keep all your skin images/thumbnails in "skins/" folder. Their names would be ".png", so for example "20.png" for skin ID 20.
  15. 50p

    its possible ?

    You can have pictures of all the skins available on your server and then simply display them in the corner of the screen. You can take a screenshot of each skin yourself and crop the face/head of them. Then you should learn some GUI scripting to display pictures and you should have no problem with that. It seems you have no or very little scripting knowledge so don't expect us to do it for you.
  16. @Ren_712, yes. It'll let me transform easier. Since dxSetShaderTransform with offset rotations makes the shader float around the screen, it's difficult to make it rotate around that point and have it rendered at X and Y if you know what I mean. Besides, I'm not sure if I could mask a "shader" (after using dxSetShaderTransform) to simply show circular radar.
  17. But seriously, http://msdn.microsoft.com/en-us/library ... 06(v=vs.85).aspx and anywhere on the internet. I use 3DPEE for writing/testing shaders http://marino.boletus.hr/3dpee.zip
  18. Thanks for the comments guys. I'm glad you find it useful. I want to make a "3D" radar, similar to the radar you find in GTA V but but in GTA V only roads are rendered. I want to use the "high detail" texture but I suck at shaders and it's going to take forever. Something like this (it's photoshopped):
  19. Doesn't getElementModel return its model?
  20. I've always wanted to do this shader but never had enough motivation. It's very simple and works great when images are the same size (that is, texture and mask). This basically is used to mask part of an image (the texture). Scroll down to see an example. I'm not going to release a resource of this because it's just 2 files that you need to add to your resource and as far as I remember you can't export classes from resources. Anyway here is what you need. Create the following 2 files: c_50masker.lua --[[ Author: 50p Version: v1.0 Description: This class allows easy creation of masked images. You can create an image and mask it using another (grayscale) image. ]] CMasker = { }; CMasker.__index = CMasker; function CMasker: create( texture, mask ) local cShader = { shader = dxCreateShader( "50masktexture.fx" ), texture = dxCreateTexture( texture, "argb", true, "clamp" ), maskTexture = dxCreateTexture( mask, "argb", true, "clamp" ), }; dxSetShaderValue( cShader.shader, "ScreenTexture", cShader.texture ); dxSetShaderValue( cShader.shader, "MaskTexture", cShader.maskTexture ); self.__index = self; setmetatable( cShader, self ); return cShader; end function CMasker: draw( x, y, width, height ) if self.shader then dxDrawImage( x, y, width, height, self.shader ); end end function CMasker: destroy( ) if self.shader then destroyElement( self.shader ); end if self.texture then destroyElement( self.texture ); end if self.maskTexture then destroyElement( self.maskTexture ); end end 50masktexture.fx /* Author: 50p Version: v1.0 Description: This shader allows you to mask a texture with a mask texture (black and white). */ texture ScreenTexture; sampler implicitInputTexture = sampler_state { Texture = <ScreenTexture>; }; texture MaskTexture; sampler implicitMaskTexture = sampler_state { Texture = <MaskTexture>; }; float4 MaskTextureMain( float2 uv : TEXCOORD0 ) : COLOR0 { float4 sampledTexture = tex2D( implicitInputTexture, uv ); float4 maskSampled = tex2D( implicitMaskTexture, uv ); sampledTexture.a = (maskSampled.r + maskSampled.g + maskSampled.b) / 3.0f; return sampledTexture; } technique Technique1 { pass Pass1 { AlphaBlendEnable = true; SrcBlend = SrcAlpha; DestBlend = InvSrcAlpha; PixelShader = compile ps_2_0 MaskTextureMain(); } } Now, make sure the shader file (50masktexture.fx) is in the root folder of your resource otherwise change the path to the shader in c_50masker.lua. When you've done this, you're ready to use the CMasker class. How to use the class?: It's simple: local masked; addEventHandler( "onClientResourceStart", resourceRoot, function( ) masked = CMasker: create( "gtasa_radar_small.png", "mask.png" ); end ) addEventHandler( "onClientRender", root, function( ) if masked then masked: draw( 700, 250, 256, 256 ); end end ) Result: REMEMBER: When you don't need to use the masked image, use destroy method to free used memory! Example: masked: destroy();
  21. I'm actually working on a simple class to allow users to apply masks to images but I'm new to shaders so it may take a bit before I learn enough about shaders to actually get it to work in MTA. I want it to be as simple to script as: CMasker: create( "texture.png", "mask.png" ); and then masker:draw( x, y, with, height ); I'll let you know when I finish. EDIT: Oh well, it took less then I thought it will take. Here it is: viewtopic.php?f=108&t=71470 have fun.
  22. I remember seeing this reported on the bugtracker but I can't seem to find it now. You're not doing anything wrong since you simply create and close the file. Try fileDelete in a script instead.
  23. https://community.multitheftauto.com/in ... ls&id=8550
  24. The only way to fix it is to scale it in 3D app. For example in 3DS Max, after you scale it, you have to reset XForm otherwise the model will not change (scale and rotation) after exporting.
×
×
  • Create New...