Skinchanger

โมดูลฝั่ง Client สำหรับปรับรูปลักษณ์ตัวละครและเสื้อผ้า ผ่าน `ESX.Skinchanger.*`

Skinchanger (Client)

หน้านี้รวมฟังก์ชันสำหรับปรับ Skin/Face/Clothing/Props ของตัวละคร

เรียกใช้งานผ่าน ESX.Skinchanger.*

circle-exclamation

กรณีแนะนำให้ปิด Skinchanger ของ NC Core

ถ้าระบบร้านเสื้อผ้า/แต่งตัวของคุณ “ผูกกับ” skinchanger ภายนอก หรือ skinchanger ภายนอกถูกเข้ารหัส แนะนำให้ปิดโมดูล skinchanger ของ NC Core เพื่อลดความเสี่ยงเรื่องการชนกัน

ให้แก้ไฟล์ fxmanifest.lua ของ NC Core แล้ว comment บรรทัด client/skinchanger.lua ออก

fxmanifest.lua
files {
	'locale.lua',

	'imports.lua',
	'lib/cl*.lua',

	'modules/shared/**/*.lua',
	'modules/client/**/*.lua',

	'functions/shared/**/*.lua',
	'functions/client/**/*.lua',

	'client/commands.lua',
	'client/death.lua',
	-- 'client/skinchanger.lua',
	'client/status.lua'
}
circle-info

หลังแก้ไข ให้ restart resource ที่เกี่ยวข้อง เพื่อให้การเปลี่ยนแปลงมีผล

กรณีที่สามารถใช้ Skinchanger ของ NC Core ได้

ถ้า skinchanger ภายนอก ไม่ถูกเข้ารหัส และไม่มี resource อื่นเรียก exports จากมัน แต่คุณมีการปรับแต่ง/เพิ่มฟีเจอร์บางอย่างไว้ คุณสามารถย้าย logic มารวมที่ NC Core แล้วใช้ NC Core เป็นตัวจัดการหลักได้

หากเซิร์ฟเวอร์มีการพัฒนาระบบร้านแต่งตัวเอง และไม่ได้จำเป็นต้องพึ่ง skinchanger ภายนอก คุณสามารถถอด resource skinchanger ภายนอกออก แล้วมาใช้งานผ่าน NC Core แทนได้

ก่อนเริ่ม (แนะนำ)

  • ตั้งค่าการเรียกใช้ Framework ให้ถูกต้องตาม Framework Usage

  • ส่งค่า ped ให้ถูกตัว (ส่วนใหญ่ใช้ PlayerPedId())

circle-exclamation

ESX.Skinchanger.SetSkin

กำหนดค่า skin “ทั้งชุด” ให้กับ ped ที่ระบุ

ครอบคลุม face features, overlays, ทรงผม, เสื้อผ้า และ props

รูปแบบการใช้งาน (Syntax)

พารามิเตอร์ (Parameters)

Name
Type
Description

ped

number

Ped handle ที่ต้องการนำ skin ไปใช้

skin

table

ตารางค่า skin ทั้งหมด (ดู key ที่รองรับด้านล่าง)

chevron-rightรายการ key ที่รองรับ (Skin properties)hashtag

Face Features

Property
Type
Range
Description

nose_1

number

0-10

Nose width

nose_2

number

0-10

Nose peak height

nose_3

number

0-10

Nose peak length

nose_4

number

0-10

Nose bone height

nose_5

number

0-10

Nose peak lowering

nose_6

number

0-10

Nose bone twist

cheeks_1

number

0-10

Cheek bone height

cheeks_2

number

0-10

Cheek bone width

cheeks_3

number

0-10

Cheek width

lip_thickness

number

0-10

Lip thickness

jaw_1

number

0-10

Jaw bone width

jaw_2

number

0-10

Jaw bone length

chin_1

number

0-10

Chin bone height

chin_2

number

0-10

Chin bone length

chin_3

number

0-10

Chin bone width

chin_4

number

0-10

Chin dimple

neck_thickness

number

0-10

Neck thickness

eye_squint

number

0-10

Eye squint

eyebrows_5

number

0-10

Eyebrow height

eyebrows_6

number

0-10

Eyebrow depth

Heritage (Face Blend)

เมื่อเปิด UseNewFaceFeature ใน config:

Property
Type
Range
Description

mom

number

0-45

Mother face index

dad

number

0-44

Father face index

face_md_weight

number

0-100

Face mix weight (%)

skin_md_weight

number

0-100

Skin mix weight (%)

เมื่อปิด UseNewFaceFeature:

Property
Type
Range
Description

face

number

0-45

Face index

skin

number

0-45

Skin color index

Overlays

Property
Type
Description

age_1

number

Ageing overlay index

age_2

number

Ageing opacity (0-10)

blemishes_1

number

Blemishes overlay index

blemishes_2

number

Blemishes opacity (0-10)

beard_1

number

Beard overlay index

beard_2

number

Beard opacity (0-10)

beard_3

number

Beard primary color

beard_4

number

Beard secondary color

eyebrows_1

number

Eyebrows overlay index

eyebrows_2

number

Eyebrows opacity (0-10)

eyebrows_3

number

Eyebrows primary color

eyebrows_4

number

Eyebrows secondary color

makeup_1

number

Makeup overlay index

makeup_2

number

Makeup opacity (0-10)

makeup_3

number

Makeup primary color

makeup_4

number

Makeup secondary color

lipstick_1

number

Lipstick overlay index

lipstick_2

number

Lipstick opacity (0-10)

lipstick_3

number

Lipstick primary color

lipstick_4

number

Lipstick secondary color

blush_1

number

Blush overlay index

blush_2

number

Blush opacity (0-10)

blush_3

number

Blush color

complexion_1

number

Complexion overlay index

complexion_2

number

Complexion opacity (0-10)

sun_1

number

Sun damage overlay index

sun_2

number

Sun damage opacity (0-10)

moles_1

number

Moles/freckles overlay index

moles_2

number

Moles/freckles opacity (0-10)

chest_1

number

Chest hair overlay index

chest_2

number

Chest hair opacity (0-10)

chest_3

number

Chest hair color

bodyb_1

number

Body blemishes overlay index

bodyb_2

number

Body blemishes opacity (0-10)

bodyb_3

number

Body blemishes 2 overlay index

bodyb_4

number

Body blemishes 2 opacity (0-10)

Hair & Eyes

Property
Type
Description

hair_1

number

Hair style drawable

hair_2

number

Hair style texture

hair_color_1

number

Hair primary color

hair_color_2

number

Hair secondary color

eye_color

number

Eye color (0-31)

Clothing Components

Property
Type
Description

tshirt_1

number

Undershirt drawable (comp 8)

tshirt_2

number

Undershirt texture

torso_1

number

Torso/jacket drawable (comp 11)

torso_2

number

Torso/jacket texture

arms

number

Arms drawable (comp 3)

arms_2

number

Arms texture

decals_1

number

Decals drawable (comp 10)

decals_2

number

Decals texture

pants_1

number

Pants drawable (comp 4)

pants_2

number

Pants texture

shoes_1

number

Shoes drawable (comp 6)

shoes_2

number

Shoes texture

mask_1

number

Mask drawable (comp 1)

mask_2

number

Mask texture

bproof_1

number

Body armor drawable (comp 9)

bproof_2

number

Body armor texture

chain_1

number

Necklace/tie drawable (comp 7)

chain_2

number

Necklace/tie texture

bags_1

number

Bags drawable (comp 5)

bags_2

number

Bags texture

Props

Property
Type
Description

helmet_1

number

Helmet prop (0 = none, prop 0)

helmet_2

number

Helmet texture

glasses_1

number

Glasses prop (0 = none, prop 1)

glasses_2

number

Glasses texture

ears_1

number

Ears accessory (0 = none, prop 2)

ears_2

number

Ears texture

watches_1

number

Watch prop (0 = none, prop 6)

watches_2

number

Watch texture

bracelets_1

number

Bracelet prop (0 = none, prop 7)

bracelets_2

number

Bracelet texture

ตัวอย่างการใช้งาน (Example)

circle-info

ถ้าใส่ key ไม่ครบ ระบบจะใช้ค่าที่มีเท่านั้น ค่าอื่นจะคงไว้ตามตัวละครปัจจุบันหรือค่าเริ่มต้นของโมดูล


ESX.Skinchanger.GetDefaultValue

อ่าน “ค่าเริ่มต้น” ของ skin component จาก config

เหมาะสำหรับตั้งค่าตอนเริ่มต้น หรือใช้เป็น fallback เมื่อข้อมูลผู้เล่นไม่ครบ

รูปแบบการใช้งาน (Syntax)

พารามิเตอร์ (Parameters)

Name
Type
Description

name

string

ชื่อ component (เช่น hair_1)

ค่าที่ส่งคืน (Returns)

Type
Description

any

ค่าเริ่มต้น หรือ nil ถ้าไม่พบ

ตัวอย่างการใช้งาน (Example)

Last updated