27.08.2018, 01:48
Quote:
HELP ME:
Код:
new SKIN_MODELS[] = { 6, 8, 10, 20, 40, 50, 120, 211, 232, 235 }; CMD:test(playerid) { ShowPlayerDialog(playerid, DIALOG_SELECT, DIALOG_STYLE_LIST, " ", "Option 0\nOption 1\nOption 2 [skins] \nOption 3","Go","Cancel"); return 1; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { switch (dialogid) { case DIALOG_SELECT: { if(response) { if(listitem == 2) { ShowPlayerDialog(playerid, DIALOG_SKIN, DIALOG_STYLE_PREVIEW_MODEL, " ", SKIN_MODELS, "Take", "Cancel"); } } } case DIALOG_SKIN: { if(response){ SetPlayerSkin(playerid, SKIN_MODELS[listitem]); DDS[playerid][cSkin] = SKIN_MODELS[listitem]; } } } return 1; } |
PHP код:
new SKIN_MODELS[] =
{
6, 8, 10, 20, 40, 50, 120, 211, 232, 235
};
CMD:test(playerid)
{
ShowPlayerDialog(playerid, DIALOG_SELECT, DIALOG_STYLE_LIST, " ", "Option 0\nOption 1\nOption 2 [skins] \nOption 3","Go","Cancel");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch (dialogid)
{
case DIALOG_SELECT:
{
if(response)
{
if(listitem == 2)
{
new string[sizeof(SKIN_MODELS)*5];
for(new i = 0; i < sizeof(SKIN_MODELS); i++)
{
format(string, sizeof string, "%s%i\n", string, SKIN_MODELS[i], SKIN_MODELS[i]);
}
ShowPlayerDialog(playerid, DIALOG_SKIN, DIALOG_STYLE_PREVIEW_MODEL, " ", string, "Take", "Cancel");
}
}
}
case DIALOG_SKIN:
{
if(response)
{
SetPlayerSkin(playerid, SKIN_MODELS[listitem]);
DDS[playerid][cSkin] = SKIN_MODELS[listitem];
}
}
}
return 1;
}