djharbi2 Posted March 29, 2020 Posted March 29, 2020 (edited) Hi, creating a new plate I want users to create a new plate using the pictures below, how can I do? example: Edited March 29, 2020 by djharbi2
The_GTA Posted March 29, 2020 Posted March 29, 2020 Hello djharbi2, did you know that you can use shaders to replace ingame textures? With shaders you can write text into a DX render-target and then attach it to a shader that would replace your license plate texture! With this technique you can create a custom license plate GUI like in your picture above. Here are some hints to lead you in the right direction: dxCreateRenderTarget - create the dynamic texture where you can draw text on dxDrawText - draw your own text onto the license plate dxDrawRectangle - you can fill that blue color on the left side with this function dxCreateShader - you have to create a shader that would replace the license plate texture of your vehicle dxSetShaderValue - function to attach your render-target with custom text to the license plate shader engineApplyShaderToWorldTexture - to attach your shader to the vehicle texture Have you already looked at the resource community for sample scripts? It is always a good idea to learn from already existing code customvehplate - seems to do what you want; you just have to adjust it to fit your style + extend for GUI! Feel free to post any questions. - Martin Developer of Magic.TXD • Developer of MTA:Eir, Eir Lua • Company owner of EirDev
djharbi2 Posted March 29, 2020 Author Posted March 29, 2020 2 hours ago, The_GTA said: Hello djharbi2, did you know that you can use shaders to replace ingame textures? With shaders you can write text into a DX render-target and then attach it to a shader that would replace your license plate texture! With this technique you can create a custom license plate GUI like in your picture above. Here are some hints to lead you in the right direction: dxCreateRenderTarget - create the dynamic texture where you can draw text on dxDrawText - draw your own text onto the license plate dxDrawRectangle - you can fill that blue color on the left side with this function dxCreateShader - you have to create a shader that would replace the license plate texture of your vehicle dxSetShaderValue - function to attach your render-target with custom text to the license plate shader engineApplyShaderToWorldTexture - to attach your shader to the vehicle texture Have you already looked at the resource community for sample scripts? It is always a good idea to learn from already existing code customvehplate - seems to do what you want; you just have to adjust it to fit your style + extend for GUI! Feel free to post any questions. - Martin Thank you for your answer, this adds pictures on the existing plate. but I want to add a picture separately. Think like a sticker.
The_GTA Posted March 29, 2020 Posted March 29, 2020 8 minutes ago, djharbi2 said: Thank you for your answer, this adds pictures on the existing plate. but I want to add a picture separately. Think like a sticker. Is the problem that the resource does just replace the text but not the surrounding plate texture? Then you could take a look at the following thread: WASSIm. did provide a really interesting answer. There are texture of vehicles called "plateback1", "plateback2", "plateback3" which should be replaced using shaders. Developer of Magic.TXD • Developer of MTA:Eir, Eir Lua • Company owner of EirDev
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now