Problem with Male Skin (Roleplay Server)
#6

This if-statement is unnecessary as it's true all the time, you can remove it:

pawn Code:
if(response || !response)
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:
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]);
    }
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)