SA-MP Forums Archive
Loop issue - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Loop issue (/showthread.php?tid=607915)



Loop issue - RedCounty - 25.05.2016

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?


Re: Loop issue - ilijap - 25.05.2016

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);



Re: Loop issue - RedCounty - 25.05.2016

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!