Jump to content

[H] Custom skin textures bound to a class.


MickeyPoo

Recommended Posts

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
Link to comment

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
Link to comment
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?

Link to comment
  • 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...