Jump to content

[H] Custom skin textures bound to a class.


MickeyPoo

Recommended Posts

Posted (edited)

Hey guys,

I'm really bad at scripting, and was wondering if someone can help me a little bit.
Does anyone have a public script or something else that can help me, to get custom skin textures bound to a class.

So for example there are two classes one is called Police1 and one is called Police2.
Police 1 = a normal police skin. LAPD1

 

KIbe25x.png

 

 


Police 2 = a modified police skin with custom textures. Also LAPD1

 

zzxJHRe.png

Edited by MickeyPoo
Posted

@MickeyPoo This is the .png file of the .txd file. All you need to do is export this image from the edited skin of the police and make it work with shaders in MTA. If you bring me that .png image of the edited police i will make it for you for free ;)

  • Like 2
Posted

I dont test it buy, i think it should work

shader.fx file

// Variable to fetch the texture from the script
texture gTexture;

// My nice technique. Requires absolutely no tools, worries nor skills
technique TexReplace
{
	pass P0
	{
		// Set the texture
		Texture[0] = gTexture;
		
		// LET THE MAGIC DO ITS MAGIC!
	}
}

client.lua file

local texture = dxCreateTexture( "lapd.png" ) -- Here you add the path of the edited .png file of the police

addCommandHandler( "jacket",
	function( cmd )
		local shader = dxCreateShader( "shader.fx", 0, 0, true, "ped" ) -- We load the shader (or create)
		setElementModel( localPlayer, 280 ) -- We add the police clothes to the player
		engineApplyShaderToWorldTexture( shader, "lapd1", localPlayer ) -- We apply the shader to the model
		dxSetShaderValue( shader, "gTexture", texture ) -- We apply the texture to the shader
		outputChatBox( "¡Hi! You set the jacket to the officer" )
	end
)

And here you have the script with the meta, etc.

http://www74.zippyshare.com/v/WWBHahoV/file.html
 

Hope i help you!

  • Like 1
Posted
20 hours ago, aka Blue said:

I dont test it buy, i think it should work

shader.fx file


// Variable to fetch the texture from the script
texture gTexture;

// My nice technique. Requires absolutely no tools, worries nor skills
technique TexReplace
{
	pass P0
	{
		// Set the texture
		Texture[0] = gTexture;
		
		// LET THE MAGIC DO ITS MAGIC!
	}
}

client.lua file


local texture = dxCreateTexture( "lapd.png" ) -- Here you add the path of the edited .png file of the police

addCommandHandler( "jacket",
	function( cmd )
		local shader = dxCreateShader( "shader.fx", 0, 0, true, "ped" ) -- We load the shader (or create)
		setElementModel( localPlayer, 280 ) -- We add the police clothes to the player
		engineApplyShaderToWorldTexture( shader, "lapd1", localPlayer ) -- We apply the shader to the model
		dxSetShaderValue( shader, "gTexture", texture ) -- We apply the texture to the shader
		outputChatBox( "¡Hi! You set the jacket to the officer" )
	end
)

And here you have the script with the meta, etc.

http://www74.zippyshare.com/v/WWBHahoV/file.html
 

Hope i help you!

can we do it to weapon models too?

Posted

Search the colt texture and try to remplace it. Now that i think, its not possible. You need to create a colt object in the ped's hand and change the texture.

  • 8 months later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...