Problem with Male Skin (Roleplay Server)
#7

Quote:
Originally Posted by Campbell-
View Post
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]);
    }
}
Getting error
Code:
E:\samp7777\samp7777\gamemodes\USA-RP.pwn(5365) : error 010: invalid function or declaration
E:\samp7777\samp7777\gamemodes\USA-RP.pwn(5366) : error 010: invalid function or declaration
E:\samp7777\samp7777\gamemodes\USA-RP.pwn(5370) : error 010: invalid function or declaration
E:\samp7777\samp7777\gamemodes\USA-RP.pwn(128010) : warning 203: symbol is never used: "femaleSkins"
E:\samp7777\samp7777\gamemodes\USA-RP.pwn(128010) : warning 203: symbol is never used: "maleSkins"
Any other idea or solution?
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)