25.04.2014, 09:50
This if-statement is unnecessary as it's true all the time, you can remove it:
If you want to set a skin by gender then organise your skins in arrays. Then you can take the size of the array and select a random skin from this array. This way you can set the skin with SetPlayerSkin() without having to check if it's a female or male skin in the first place:
pawn Code:
if(response || !response)
pawn Code:
new const maleSkins[] = {0, 1 /* , ... */};
new const femaleSkins[] = {9, 10 /* , ... */};
switch(PlayerInfo[playerid][pSex]) {
case 2: {
PlayerInfo[playerid][pModel] = femaleSkins[random(sizeof(femaleSkins))];
SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]);
}
default: {
PlayerInfo[playerid][pModel] = maleSkins[random(sizeof(maleSkins))];
SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]);
}
}