Jump to content

Skin selector with sorted skins


Artisz

Recommended Posts

Yeah, that's what I want, thanks:D

I have no script, because I don't know have can I make.

I just know that there are two tables, for example:

local maleskins = {1,3,5,7} 
local femaleskins = {0,2,4,6} 

And there is two button, a male and a female button, where we can choose, what table are we want to use. After that, whitin the choosen table we can change the skin.

I don't want to write it for me, just help start this.

If you can help me, I'd be happy.

Sorry for my English!

Link to comment
Yeah, that's what I want, thanks:D

I have no script, because I don't know have can I make.

I just know that there are two tables, for example:

[codelua]local male = {1,3,5,7}
local female = {0,2,4,6}[/code]

And there is two button, a male and a female button, where we can choose, what table are we want to use. After that, whitin the choosen table we can change the skin.

I don't want to write it for me, just help start this.

If you can help me, I'd be happy.

Sorry for my English!

Ok, for the GUI, you can use the in-game GUI Editor, for the skin IDs, you have the tables here: https://wiki.multitheftauto.com/wiki/Character_Skins

maleSkins = {0, 1, 2, 7, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 32, 33, 34, 35, 36, 37, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 57, 58, 59, 60, 61, 62, 66, 67, 68, 70, 71, 72, 73, 78, 79, 80, 81, 82, 83, 84, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 120, 121, 122, 123, 124, 125, 126, 127, 128, 132, 133, 134, 135, 136, 137, 142, 143, 144, 146, 147, 153, 154, 155, 156, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 170, 171, 173, 174, 175, 176, 177, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 200, 202, 203, 204, 206, 209, 210, 212, 213, 217, 220, 221, 222, 223, 227, 228, 229, 230, 234, 235, 236, 239, 240, 241, 242, 247, 248, 249, 250, 252, 253, 254, 255, 258, 259, 260, 261, 262, 264, 265, 266, 267, 268, 269, 270, 271, 272, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 290, 291, 292, 293, 294, 295, 296, 297, 299, 300, 301, 302, 303, 305, 306, 307, 308, 309, 310, 311, 312} 
femaleSkins = {9, 10, 11, 12, 13, 31, 38, 39, 40, 41, 53, 54, 55, 56, 63, 64, 69, 75, 76, 77, 85, 87, 88, 89, 90, 91, 92, 93, 129, 130, 131, 138, 139, 140, 141, 145, 148, 150, 151, 152, 157, 169, 172, 178, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 201, 205, 207, 211, 214, 215, 216, 218, 219, 224, 225, 226, 231, 232, 233, 237, 238, 243, 244, 245, 246, 251, 256, 257, 263, 298, 304} 

now, you can make it like that:

selectedTable = maleSkins 
skinPlace = 1 
local selectedSkin = table.concat(selectedTable, _, skinPlace) -- I'm not sure tor that, I have never make skin selector 

with a onClientGUIClick button you can add this:

skinPlace = skinPlace + 1 -- For the "Next" button 
skinPlace = skinPlace - 1 -- For the "Previous" button 
selectedTable = maleSkins -- For the "Males" button 
selectedTable = femaleSkins -- For the "Females" button 
setElementModel(thePed, selectedSkin) 

I'm not sur for the "table.concat" because I have never made skin selector, but you can try ;)

Link to comment

Thanks for help, but I still have some problem.

I don't know why it is do it:

235723310N_vtelen-1_www.kepfeltoltes.hu_.png

Here is the code with the line 460:

maleSkins = {0, 1, 2, 7, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 32, 33, 34, 35, 36, 37, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 57, 58, 59, 60, 61, 62, 66, 67, 68, 70, 71, 72, 73, 78, 79, 80, 81, 82, 83, 84, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 120, 121, 122, 123, 124, 125, 126, 127, 128, 132, 133, 134, 135, 136, 137, 142, 143, 144, 146, 147, 153, 154, 155, 156, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 170, 171, 173, 174, 175, 176, 177, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 200, 202, 203, 204, 206, 209, 210, 212, 213, 217, 220, 221, 222, 223, 227, 228, 229, 230, 234, 235, 236, 239, 240, 241, 242, 247, 248, 249, 250, 252, 253, 254, 255, 258, 259, 260, 261, 262, 264, 265, 266, 267, 268, 269, 270, 271, 272, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 290, 291, 292, 293, 294, 295, 296, 297, 299, 300, 301, 302, 303, 305, 306, 307, 308, 309, 310, 311, 312} 
femaleSkins = {9, 10, 11, 12, 13, 31, 38, 39, 40, 41, 53, 54, 55, 56, 63, 64, 69, 75, 76, 77, 85, 87, 88, 89, 90, 91, 92, 93, 129, 130, 131, 138, 139, 140, 141, 145, 148, 150, 151, 152, 157, 169, 172, 178, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 201, 205, 207, 211, 214, 215, 216, 218, 219, 224, 225, 226, 231, 232, 233, 237, 238, 243, 244, 245, 246, 251, 256, 257, 263, 298, 304} 
local selectedTable = maleSkins 
local skinPlace = 1 
  
  
elseif (source == char_male) then 
            selectedTable = maleSkins 
        elseif (source == char_female) then 
            selectedTable = femaleSkins 
        elseif (source == char_arrow_right) then 
            skinPlace = skinPlace + 1 
        elseif (source == char_arrow_left) then 
            skinPlace = skinPlace - 1 
  
  
  
  
--It has an OnClientRender handler: 
  
function skinSelector() 
    local selectedSkin = table.concat(selectedTable, _, skinPlace) 
    if (tonumber(selectedSkin) > 9) then 
        dxDrawImage(50,50,60,60,"kep/0"..selectedSkin..".png",atlatszo_charmaker) --Line 460 
    else 
        dxDrawImage(50,50,360,120,"kep/00"..selectedSkin..".png",atlatszo_charmaker) 
    end 
end 

Link to comment

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...