[HELP] Random skin
#1

I'm trying to create something that gives out random skins when a player selects a gener from a dialog. The problem I get here is if I choose a female gender it give me a male skin and if I choose male as a gener it can give me a female skin. Can someone please check this over and see if I made some error?

I get two warnings:

pawn Код:
symbol is never used: "MaleSkins"
symbol is never used: "FemaleSkins"
pawn Код:
new MaleSkins[201][1] = {
{0}, {1}, {2}, {7}, {14}, {15}, {16}, {17}, {18}, {19}, {20},
{21}, {22}, {23}, {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}, {68}, {70}, {71}, {72}, {73}, {78}, {79}, {80},
{81}, {82}, {83}, {84}, {95}, {96}, {97}, {98}, {99}, {100},
{101}, {102}, {103}, {104}, {105}, {106}, {107}, {108}, {109}, {110},
{111}, {112}, {113}, {114}, {115}, {116}, {117}, {118}, {119}, {120},
{121}, {122}, {123}, {124}, {125}, {126}, {127}, {128}, {133}, {134},
{135}, {136}, {137}, {142}, {143}, {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}, {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}
};

new FemaleSkins[76][1] = {
{9}, {10}, {11}, {12}, {13}, {31}, {38}, {39}, {40}, {41},
{53}, {54}, {55}, {56}, {63}, {64}, {69}, {75}, {76}, {77},
{85}, {87}, {88}, {89}, {91}, {92}, {93}, {129}, {131}, {138},
{139}, {140}, {141}, {145}, {148}, {150}, {151}, {152}, {157}, {169},
{178}, {190}, {191}, {192}, {193}, {194}, {195}, {196}, {197}, {198},
{199}, {201}, {207}, {211}, {214}, {215}, {216}, {218}, {219}, {224},
{225}, {226}, {231}, {232}, {233}, {237}, {238}, {243}, {244}, {245},
{246}, {251}, {256}, {257}, {263}, {298}
};
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
    {
        case 1:
        {
            if(!response)
            {
                return 1;
            }
            switch(listitem)
            {
                case 0:
                {
                    ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "What does the term RP mean?", "Radar Processor\r\nRadial Pulse\r\nRole Play\r\nRapid Patch\r\nReference Publication", "OK", "");
                    new maleskin;
                    maleskin = random(sizeof(MaleSkins));
                    SetPlayerSkin(playerid, maleskin);
                    PlayerInfo[playerid][pGender] = 1;
                    PlayerInfo[playerid][pSkin] = maleskin;
                }
                case 1:
                {
                    ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "What does the term RP mean?", "Radar Processor\r\nRadial Pulse\r\nRole Play\r\nRapid Patch\r\nReference Publication", "OK", "");
                    new femaleskin;
                    femaleskin = random(sizeof(FemaleSkins));
                    SetPlayerSkin(playerid, femaleskin);
                    PlayerInfo[playerid][pGender] = 2;
                    PlayerInfo[playerid][pSkin] = femaleskin;
                }
            }
        }
    }
    return 0;
}
Thanks
Reply
#2

pawn Код:
PlayerInfo[playerid][pSkin] = MaleSkins[maleskin];
Same for female. Also remove the second dimension in these arrays and put it like
pawn Код:
new MaleSkins[] = {
0, 1, 2, 7, 14, 15, 16, 17, 18, 19, 20, // etc
};
Reply
#3

Quote:
Originally Posted by Vince
Посмотреть сообщение
pawn Код:
PlayerInfo[playerid][pSkin] = MaleSkins[maleskin];
Same for female. Also remove the second dimension in these arrays and put it like
pawn Код:
new MaleSkins[] = {
0, 1, 2, 7, 14, 15, 16, 17, 18, 19, 20, // etc
};
I'll test this, stand-by.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)