if(RegistrationStep[playerid] != 0) { if(dialogid == REGISTERSEX) { if(response) { new stringdiag[410]; for(new x=18;x<99;x++) { format(stringdiag, sizeof(stringdiag), "%s%d\n", stringdiag, x); } if(listitem == 0) { PlayerInfo[playerid][pSex] = 1; SendClientMessageEx(playerid, COLOR_LIGHTRED, "Alright, so you're a male."); ShowPlayerDialog(playerid, REGISTERAGE, DIALOG_STYLE_LIST, "{33CCFF}What is your characters age? - www.usa-rp.cf", stringdiag, "Submit", ""); RegistrationStep[playerid] = 2; } else { PlayerInfo[playerid][pSex] = 2; SendClientMessageEx(playerid, COLOR_LIGHTRED, "Alright, so you're a female."); ShowPlayerDialog(playerid, REGISTERAGE, DIALOG_STYLE_LIST, "{33CCFF}What is your characters age? - www.usa-rp.cf", stringdiag, "Submit", ""); RegistrationStep[playerid] = 2; } } else { ShowPlayerDialog(playerid, REGISTERSEX, DIALOG_STYLE_LIST, "{33CCFF}Is your character male or female? - www.usa-rp.cf", "Male\nFemale", "Submit", ""); } }
if(dialogid == DIALOG_SPAWN) { if(response || !response) { for(new x;x<10000;x++) { new rand=random(300); if(PlayerInfo[playerid][pSex] == 0) { if(IsValidSkin(rand)) { PlayerInfo[playerid][pModel] = rand; SetPlayerSkin(playerid, rand); break; } } else { if(IsFemaleSkin(rand)) { PlayerInfo[playerid][pModel] = rand; SetPlayerSkin(playerid, rand); break; } } }
stock IsValidSkin(skinid) { if (skinid < 0 || skinid > 299) return 0; switch (skinid) { case 0, 69, 123, 147, 163, 21, 24, 143, 71, 156, 176, 177, 165, 166, 275, 265, 266, 267, 269, 270, 271, 274, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 294, 296, 297: return 0; } return 1; } stock IsFemaleSpawnSkin(skinid) { switch (skinid) { case 9, 11, 12, 13, 31, 38, 39, 40, 41, 53, 54, 55, 56, 65, 76, 77, 89, 91, 93, 129, 130, 131, 141, 148, 150, 151, 157, 169, 172, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 211, 214, 215, 216, 218, 219, 224, 225, 226, 231, 232, 233, 263, 298: return 1; } return 0; } stock IsFemaleSkin(skinid) { switch (skinid) { case 9, 11, 12, 13, 31, 38, 39, 40, 41, 53, 54, 55, 56, 63, 64, 65, 75, 76, 77, 85, 87, 88, 89, 90, 91, 92, 93, 129, 130, 131, 138, 139, 140, 141, 145, 148, 150, 151, 152, 157, 169, 172, 178, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 201, 205, 207, 211, 214, 215, 216, 218, 219, 224, 225, 226, 231, 232, 233, 237, 238, 243, 244, 245, 246, 251, 256, 257, 263, 298: return 1; } return 0; }
if(response || !response)
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]);
}
}
This if-statement is unnecessary as it's true all the time, you can remove it:
pawn Code:
pawn 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"
Rapid bumper.
Nice. Anyway,, Show part of codes where female and male skin is. |
stock IsValidSkin(skinid) { if (skinid < 0 || skinid > 299) return 0; switch (skinid) { case 0, 69, 123, 147, 163, 21, 24, 143, 71, 156, 176, 177, 165, 166, 275, 265, 266, 267, 269, 270, 271, 274, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 294, 296, 297: return 0; } return 1; } stock IsFemaleSpawnSkin(skinid) { switch (skinid) { case 9, 11, 12, 13, 31, 38, 39, 40, 41, 53, 54, 55, 56, 65, 76, 77, 89, 91, 93, 129, 130, 131, 141, 148, 150, 151, 157, 169, 172, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 211, 214, 215, 216, 218, 219, 224, 225, 226, 231, 232, 233, 263, 298: return 1; } return 0; } stock IsFemaleSkin(skinid) { switch (skinid) { case 9, 11, 12, 13, 31, 38, 39, 40, 41, 53, 54, 55, 56, 63, 64, 65, 75, 76, 77, 85, 87, 88, 89, 90, 91, 92, 93, 129, 130, 131, 138, 139, 140, 141, 145, 148, 150, 151, 152, 157, 169, 172, 178, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 201, 205, 207, 211, 214, 215, 216, 218, 219, 224, 225, 226, 231, 232, 233, 237, 238, 243, 244, 245, 246, 251, 256, 257, 263, 298: return 1; } return 0; }
You save their skin as "1" or "2", then check if it is "0", which it never is.
|