18.04.2015, 06:40
Try this:
PHP код:
public OnPlayerRequestClass(playerid, classid)
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "What is your genre?", "Male\nFemale", "Select", "Quit");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid==1)
{
if(!response) return ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "What is your genre?", "Male\nFemale", "Select", "Quit");
if(listitem==0)
{
new bool:Success;
while(!Success)
{
new skin=random(300);
if(skin<9 || (skin>13 && skin<39 && skin!=31) || (skin>41 && skin<53) || (skin>56 && skin<63) || (skin>65 & skin<75 && skin!=69) || (skin>77 && skin<87 && skin!=85)
|| (skin>93 && skin<129) || (skin>131 && skin<138) || (skin>141 && skin<150 && skin!=145 skin!=148) || (skin>152 && skin<190 && skin!=157 && skin!=169 && skin!=172 && skin!=178) || skin==200 || (skin>201 && skin<214 & skin!=205 && skin!=207 && skin!=211)
|| skin==217 || (skin>219 & skin<224) || (skin>226 && skin<231) || (skin>233 & skin<237) || (skin>238 && skin<243) || (skin>246 && skin<256 && skin!=251) || (skin>257 && skin!=263 && skin!=298)) Success=true;
if(Success)
{
SpawnPlayer(playerid);
SetPlayerSkin(playerid, skin);
}
}
}
if(listitem==1)
{
new bool:Success=true;
while(!Success)
{
new skin=random(300);
if(skin<9 || (skin>13 && skin<39 && skin!=31) || (skin>41 && skin<53) || (skin>56 && skin<63) || (skin>65 & skin<75 && skin!=69) || (skin>77 && skin<87 && skin!=85)
|| (skin>93 && skin<129) || (skin>131 && skin<138) || (skin>141 && skin<150 && skin!=145 skin!=148) || (skin>152 && skin<190 && skin!=157 && skin!=169 && skin!=172 && skin!=178) || skin==200 || (skin>201 && skin<214 & skin!=205 && skin!=207 && skin!=211)
|| skin==217 || (skin>219 & skin<224) || (skin>226 && skin<231) || (skin>233 & skin<237) || (skin>238 && skin<243) || (skin>246 && skin<256 && skin!=251) || (skin>257 && skin!=263 && skin!=298)) Success=false;
if(Success)
{
SpawnPlayer(playerid);
SetPlayerSkin(playerid, skin);
}
}
}
}
return 1;
}