Loop issue
#1

I've got this:

pawn Код:
new skins[315];
for(new i = 0; i < 311; i++){
    if(IsSkinAvailable(i) && IsValidSkin(i)){
        skins[i] = i;
    }
}
   
setClothingPosition(playerid);
ShowModelSelectionMenuEx(playerid, skins, 311, "Buy Clothing", CUSTOM_SKIN_MENU, 0.0, 0.0, 0.0, 1.0, 0x00000066, 0x39393833, 0x39393833);
But for some reason, it's showing a LOT of CJ skins. - Here:

Anyone able to help?
Reply
#2

Try this

pawn Код:
new skins[315];
for(new i = 0, num=0; i < 311; i++){
    if(IsSkinAvailable(i) && IsValidSkin(i)){
        skins[num] = i;
        num++;
    }
}
   
setClothingPosition(playerid);
ShowModelSelectionMenuEx(playerid, skins, 311, "Buy Clothing", CUSTOM_SKIN_MENU, 0.0, 0.0, 0.0, 1.0, 0x00000066, 0x39393833, 0x39393833);
Reply
#3

Quote:
Originally Posted by ilijap
Посмотреть сообщение
Try this

pawn Код:
new skins[315];
for(new i = 0, num=0; i < 311; i++){
    if(IsSkinAvailable(i) && IsValidSkin(i)){
        skins[num] = i;
        num++;
    }
}
   
setClothingPosition(playerid);
ShowModelSelectionMenuEx(playerid, skins, 311, "Buy Clothing", CUSTOM_SKIN_MENU, 0.0, 0.0, 0.0, 1.0, 0x00000066, 0x39393833, 0x39393833);
Yeah, beat you to it. I posted before thinking lol, thank you anyway! This is what I have:

pawn Код:
new skins[315], count=0;
    for(new i = 0; i < 311; i++){
        if(IsSkinAvailable(i)){
            skins[count] = i;
            count++;
        }
    }
Repped ya!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)