Hi, i got a script which allows you to wear items etc.But commands which i used to view menu, doesn't work.It says : Unknown Command.Anyway to make it work ?
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case DIALOG_ATTACH_INDEX_SELECTION:
{
if(response)
{
if(IsPlayerAttachedObjectSlotUsed(playerid, listitem))
{
ShowPlayerDialog(playerid, DIALOG_ATTACH_EDITREPLACE, DIALOG_STYLE_MSGBOX, "{FF0000}Modyfikowanie Dodatkуw", "Chcesz edytować aktulany dodatek czy usunąć?", "Edytuj", "Usuń");
}
else
{
new bigstring[4050];
for(new x;x<sizeof(AttachmentObjects);x++)
{
format(bigstring, sizeof(bigstring), "%s%s\n", bigstring, AttachmentObjects[x][attachname]);
}
ShowPlayerDialog(playerid, DIALOG_ATTACH_MODEL_SELECTION, DIALOG_STYLE_LIST, \
"{FF0000}Modyfikownie Dodatkуw - Wybieranie Modelu", bigstring, "Wybierz", "Zamknij");
}
SetPVarInt(playerid, "AttachmentIndexSel", listitem);
}
else ShowPlayerDialog(playerid, HOLDMENU3E, DIALOG_STYLE_LIST, "{F42626}Ustaw lub Edytuj", "Załуrz/Zciągnij aktualny dodatek \nDodaj/Podmień dodatek \nEdytuj Dodatek", "Wybierz", "Zamknij");
}
case DIALOG_ATTACH_EDITREPLACE:
{
if(response) EditAttachedObject(playerid, GetPVarInt(playerid, "AttachmentIndexSel"));
else
{
RemovePlayerAttachedObject(playerid, GetPVarInt(playerid, "AttachmentIndexSel"));
PlayerAttatchedObjects[playerid][pmodel][GetPVarInt(playerid, "AttachmentIndexSel")] = 0;
SavePObjects(playerid, GetPVarInt(playerid, "AttachmentIndexSel"));
}
DeletePVar(playerid, "AttachmentIndexSel");
}
case DIALOG_ATTACH_MODEL_SELECTION:
{
if(response)
{
SetPVarInt(playerid, "AttachmentModelSel", AttachmentObjects[listitem][attachmodel]);
new holdstring[260];
for(new x;x<sizeof(AttachmentBones);x++)
{
format(holdstring, sizeof(holdstring), "%s%s\n", holdstring, AttachmentBones[x]);
}
ShowPlayerDialog(playerid, DIALOG_ATTACH_BONE_SELECTION, DIALOG_STYLE_LIST, "{FF0000}Modyfikowanie Dodatkуw - Wybуr Kości (?)", holdstring, "Wybierz", "Zamknij");
}
else DeletePVar(playerid, "AttachmentIndexSel");
}
case DIALOG_ATTACH_BONE_SELECTION:
{
if(response)
{
SetPlayerAttachedObject(playerid, GetPVarInt(playerid, "AttachmentIndexSel"), GetPVarInt(playerid, "AttachmentModelSel"), listitem+1);
EditAttachedObject(playerid, GetPVarInt(playerid, "AttachmentIndexSel"));
SendClientMessage(playerid, 0xFFFFFFFF, "Podpowiedź: Użyj {FFFF00}~k~~Spacji~{FFFFFF} aby się rozglądać.");
}
DeletePVar(playerid, "AttachmentIndexSel");
DeletePVar(playerid, "AttachmentModelSel");
}
case HOLDADDDIALOG:
{
new stringb[4050];
if(!response) return ShowPlayerDialog(playerid, HOLDMENU3E, DIALOG_STYLE_LIST, "{F42626}Ustaw lub Edytuj", "Ubierz/Zciągnij dodatek \nDodaj/Zamien dodatek \nEdytuj dodatek", "Wybierz", "Zamknij");
for(new x;x<sizeof(AttachmentObjects);x++)
{
format(stringb, sizeof(stringb), "%s%s\n", stringb, AttachmentObjects[x][attachname]);
}
ShowPlayerDialog(playerid, DIALOG_ATTACH_MODEL_SELECTION, DIALOG_STYLE_LIST, \
"{FF0000}Modyfikacja - Wybуr Modelu", stringb, "Wybierz", "Zamknij");
SetPVarInt(playerid, "AttachmentIndexSel", listitem);
}
case HOLDMENU3E:
{
if(!response) return 1;
switch(listitem)
{
case 0:
{
new holdstring[800];
for(new x;x<MAX_PLAYER_ATTACHED_OBJECTS;x++)
{
new model = PlayerAttatchedObjects[playerid][pmodel][x];
if(PlayerAttatchedObjects[playerid][pmodel][x] > 18000)
{
if(IsPlayerAttachedObjectSlotUsed(playerid, x)) format(holdstring, sizeof(holdstring), "%sSlot: %d Dodatek: %s {43D017}(Używany){FFFFFF}\n", holdstring, x, GetAttachedModelName(model));
else format(holdstring, sizeof(holdstring), "%sSlot: %d Dodatek: %s\n", holdstring, x, GetAttachedModelName(model));
}
else format(holdstring, sizeof(holdstring), "%sSlot: %d Dodatek: Brak\n", holdstring, x);
}
ShowPlayerDialog(playerid, SETHOLDDIALOG, DIALOG_STYLE_LIST, \
"{FF0000}Ustaw Dodatek - Wybуr Slotu", holdstring, "Wybierz", "Wrуć");
}
case 1:
{
new holdstring[800];
for(new x;x<MAX_PLAYER_ATTACHED_OBJECTS;x++)
{
new model = PlayerAttatchedObjects[playerid][pmodel][x];
if(PlayerAttatchedObjects[playerid][pmodel][x] > 18000) format(holdstring, sizeof(holdstring), "%sSlot: %d Dodatek: %s\n", holdstring, x, GetAttachedModelName(model));
else format(holdstring, sizeof(holdstring), "%sSlot: %d Dodatek: Brak\n", holdstring, x);
}
ShowPlayerDialog(playerid, HOLDADDDIALOG, DIALOG_STYLE_LIST, \
"{FF0000}Dodaj/Zamień Dodatek - Wybуr Slotu", holdstring, "Wybierz", "Wrуć");
}
case 2:
{
new holdstring[300];
for(new x;x<MAX_PLAYER_ATTACHED_OBJECTS;x++)
{
if(IsPlayerAttachedObjectSlotUsed(playerid, x))
{
new model = PlayerAttatchedObjects[playerid][pmodel][x];
format(holdstring, sizeof(holdstring), "%sSlot: %d Dodatek: %s (Używany)\n", holdstring, x, GetAttachedModelName(model));
}
else
{
if(PlayerAttatchedObjects[playerid][pmodel][x] > 18000)
{
new model = PlayerAttatchedObjects[playerid][pmodel][x];
format(holdstring, sizeof(holdstring), "%sSlot: %d Dodatek: %s\n", holdstring, x, GetAttachedModelName(model));
}
else format(holdstring, sizeof(holdstring), "%sSlot: %d Dodatek: Brak\n", holdstring, x);
}
}
ShowPlayerDialog(playerid, DIALOG_ATTACH_INDEX_SELECTION, DIALOG_STYLE_LIST, \
"{FF0000}Modyfikacja Dodatku - Wybуr Slotu", holdstring, "Wybierz", "Wrуć");
}
}
}
case SETHOLDDIALOG:
{
if(!response) return ShowPlayerDialog(playerid, HOLDMENU3E, DIALOG_STYLE_LIST, "{F42626}Ustaw lub Edytuj", "Ubierz/Zciągnij dodatek\nDodaj/Zmień dodatek \nEdytuj dodatek", "Wybierz", "Wyjdź");
switch(listitem)
{
case 0:
{
if(PlayerAttatchedObjects[playerid][pUsingSlot][0] == 0)
{
SetPlayerAttachedObject(playerid, 0, PlayerAttatchedObjects[playerid][pmodel][0], PlayerAttatchedObjects[playerid][pbone][0], PlayerAttatchedObjects[playerid][pfX][0], PlayerAttatchedObjects[playerid][pfY][0], PlayerAttatchedObjects[playerid][pfZ][0],
PlayerAttatchedObjects[playerid][prX][0], PlayerAttatchedObjects[playerid][prY][0], PlayerAttatchedObjects[playerid][prZ][0], PlayerAttatchedObjects[playerid][psX][0], PlayerAttatchedObjects[playerid][psY][0], PlayerAttatchedObjects[playerid][psZ][0]);
PlayerAttatchedObjects[playerid][pUsingSlot][0] = 1;
GameTextForPlayer(playerid, "Dodatek Założony", 1200, 3);
}
else
{
RemovePlayerAttachedObject(playerid, 0);
PlayerAttatchedObjects[playerid][pUsingSlot][0] = 0;
SendClientMessage(playerid, -1, "{0BDDC4}[Dodatki]{FFFFFF} Dodatek usunięty.");
}
SavePObjects(playerid, 0);
}
case 1:
{
if(PlayerAttatchedObjects[playerid][pUsingSlot][1] == 0)
{
SetPlayerAttachedObject(playerid, 1, PlayerAttatchedObjects[playerid][pmodel][1], PlayerAttatchedObjects[playerid][pbone][1], PlayerAttatchedObjects[playerid][pfX][1], PlayerAttatchedObjects[playerid][pfY][1], PlayerAttatchedObjects[playerid][pfZ][1],
PlayerAttatchedObjects[playerid][prX][1], PlayerAttatchedObjects[playerid][prY][1], PlayerAttatchedObjects[playerid][prZ][1], PlayerAttatchedObjects[playerid][psX][1], PlayerAttatchedObjects[playerid][psY][1], PlayerAttatchedObjects[playerid][psZ][1]);
PlayerAttatchedObjects[playerid][pUsingSlot][1] = 1;
GameTextForPlayer(playerid, "Dodatek Założony", 1200, 3);
}
else
{
RemovePlayerAttachedObject(playerid, 1);
PlayerAttatchedObjects[playerid][pUsingSlot][1] = 0;
SendClientMessage(playerid, -1, "{0BDDC4}[Obiekty]{FFFFFF} Dodatek usunięty!");
}
SavePObjects(playerid, 1);
}
case 2:
{
if(PlayerAttatchedObjects[playerid][pUsingSlot][2] == 0)
{
SetPlayerAttachedObject(playerid, 2, PlayerAttatchedObjects[playerid][pmodel][2], PlayerAttatchedObjects[playerid][pbone][2], PlayerAttatchedObjects[playerid][pfX][2], PlayerAttatchedObjects[playerid][pfY][2], PlayerAttatchedObjects[playerid][pfZ][2],
PlayerAttatchedObjects[playerid][prX][2], PlayerAttatchedObjects[playerid][prY][2], PlayerAttatchedObjects[playerid][prZ][2], PlayerAttatchedObjects[playerid][psX][2], PlayerAttatchedObjects[playerid][psY][2], PlayerAttatchedObjects[playerid][psZ][2]);
PlayerAttatchedObjects[playerid][pUsingSlot][2] = 1;
GameTextForPlayer(playerid, "Dodatek Założony", 1200, 3);
}
else
{
RemovePlayerAttachedObject(playerid, 2);
PlayerAttatchedObjects[playerid][pUsingSlot][2] = 0;
SendClientMessage(playerid, -1, "{0BDDC4}[Obiekty]{FFFFFF} Dodatek usunięty!");
}
SavePObjects(playerid, 2);
}
case 3:
{
if(PlayerAttatchedObjects[playerid][pUsingSlot][3] == 0)
{
SetPlayerAttachedObject(playerid, 3, PlayerAttatchedObjects[playerid][pmodel][3], PlayerAttatchedObjects[playerid][pbone][3], PlayerAttatchedObjects[playerid][pfX][3], PlayerAttatchedObjects[playerid][pfY][3], PlayerAttatchedObjects[playerid][pfZ][3],
PlayerAttatchedObjects[playerid][prX][3], PlayerAttatchedObjects[playerid][prY][3], PlayerAttatchedObjects[playerid][prZ][3], PlayerAttatchedObjects[playerid][psX][3], PlayerAttatchedObjects[playerid][psY][3], PlayerAttatchedObjects[playerid][psZ][3]);
PlayerAttatchedObjects[playerid][pUsingSlot][3] = 1;
GameTextForPlayer(playerid, "Dodatek Założony", 1200, 3);
}
else
{
RemovePlayerAttachedObject(playerid, 3);
PlayerAttatchedObjects[playerid][pUsingSlot][3] = 0;
SendClientMessage(playerid, -1, "{0BDDC4}[Obiekty]{FFFFFF} Dodatek usunięty!");
}
SavePObjects(playerid, 3);
}
case 4:
{
if(PlayerAttatchedObjects[playerid][pUsingSlot][4] == 0)
{
SetPlayerAttachedObject(playerid, 4, PlayerAttatchedObjects[playerid][pmodel][4], PlayerAttatchedObjects[playerid][pbone][4], PlayerAttatchedObjects[playerid][pfX][4], PlayerAttatchedObjects[playerid][pfY][4], PlayerAttatchedObjects[playerid][pfZ][4],
PlayerAttatchedObjects[playerid][prX][4], PlayerAttatchedObjects[playerid][prY][4], PlayerAttatchedObjects[playerid][prZ][4], PlayerAttatchedObjects[playerid][psX][4], PlayerAttatchedObjects[playerid][psY][4], PlayerAttatchedObjects[playerid][psZ][4]);
PlayerAttatchedObjects[playerid][pUsingSlot][4] = 1;
GameTextForPlayer(playerid, "Dodatek Założony", 1200, 3);
}
else
{
RemovePlayerAttachedObject(playerid, 4);
PlayerAttatchedObjects[playerid][pUsingSlot][4] = 0;
SendClientMessage(playerid, -1, "{0BDDC4}[Obiekty]{FFFFFF} Dodatek usunięty!");
}
SavePObjects(playerid, 4);
}
case 5:
{
if(PlayerAttatchedObjects[playerid][pUsingSlot][5] == 0)
{
SetPlayerAttachedObject(playerid, 5, PlayerAttatchedObjects[playerid][pmodel][5], PlayerAttatchedObjects[playerid][pbone][5], PlayerAttatchedObjects[playerid][pfX][5], PlayerAttatchedObjects[playerid][pfY][5], PlayerAttatchedObjects[playerid][pfZ][5],
PlayerAttatchedObjects[playerid][prX][5], PlayerAttatchedObjects[playerid][prY][5], PlayerAttatchedObjects[playerid][prZ][5], PlayerAttatchedObjects[playerid][psX][5], PlayerAttatchedObjects[playerid][psY][5], PlayerAttatchedObjects[playerid][psZ][5]);
PlayerAttatchedObjects[playerid][pUsingSlot][5] = 1;
GameTextForPlayer(playerid, "Dodatek Założony", 1200, 3);
}
else
{
RemovePlayerAttachedObject(playerid, 5);
PlayerAttatchedObjects[playerid][pUsingSlot][5] = 0;
SendClientMessage(playerid, -1, "{0BDDC4}[Obiekty]{FFFFFF} Dodatek usunięty!");
}
SavePObjects(playerid, 5);
}
case 6:
{
if(PlayerAttatchedObjects[playerid][pUsingSlot][6] == 0)
{
SetPlayerAttachedObject(playerid, 6, PlayerAttatchedObjects[playerid][pmodel][6], PlayerAttatchedObjects[playerid][pbone][6], PlayerAttatchedObjects[playerid][pfX][6], PlayerAttatchedObjects[playerid][pfY][6], PlayerAttatchedObjects[playerid][pfZ][6],
PlayerAttatchedObjects[playerid][prX][6], PlayerAttatchedObjects[playerid][prY][6], PlayerAttatchedObjects[playerid][prZ][6], PlayerAttatchedObjects[playerid][psX][6], PlayerAttatchedObjects[playerid][psY][6], PlayerAttatchedObjects[playerid][psZ][6]);
PlayerAttatchedObjects[playerid][pUsingSlot][6] = 1;
GameTextForPlayer(playerid, "Dodatek Założony", 1200, 3);
}
else
{
RemovePlayerAttachedObject(playerid, 6);
PlayerAttatchedObjects[playerid][pUsingSlot][6] = 0;
SendClientMessage(playerid, -1, "{0BDDC4}[Obiekty]{FFFFFF} Dodatek usunięty!");
}
SavePObjects(playerid, 6);
}
case 7:
{
if(PlayerAttatchedObjects[playerid][pUsingSlot][7] == 0)
{
SetPlayerAttachedObject(playerid, 7, PlayerAttatchedObjects[playerid][pmodel][7], PlayerAttatchedObjects[playerid][pbone][7], PlayerAttatchedObjects[playerid][pfX][7], PlayerAttatchedObjects[playerid][pfY][7], PlayerAttatchedObjects[playerid][pfZ][7],
PlayerAttatchedObjects[playerid][prX][7], PlayerAttatchedObjects[playerid][prY][7], PlayerAttatchedObjects[playerid][prZ][7], PlayerAttatchedObjects[playerid][psX][7], PlayerAttatchedObjects[playerid][psY][7], PlayerAttatchedObjects[playerid][psZ][7]);
PlayerAttatchedObjects[playerid][pUsingSlot][7] = 1;
GameTextForPlayer(playerid, "Dodatek Założony", 1200, 3);
}
else
{
RemovePlayerAttachedObject(playerid, 7);
PlayerAttatchedObjects[playerid][pUsingSlot][7] = 0;
SendClientMessage(playerid, -1, "{0BDDC4}[Obiekty]{FFFFFF} Dodatek usunięty!");
}
SavePObjects(playerid, 7);
}
case 8:
{
if(PlayerAttatchedObjects[playerid][pUsingSlot][8] == 0)
{
SetPlayerAttachedObject(playerid, 8, PlayerAttatchedObjects[playerid][pmodel][8], PlayerAttatchedObjects[playerid][pbone][8], PlayerAttatchedObjects[playerid][pfX][8], PlayerAttatchedObjects[playerid][pfY][8], PlayerAttatchedObjects[playerid][pfZ][8],
PlayerAttatchedObjects[playerid][prX][8], PlayerAttatchedObjects[playerid][prY][8], PlayerAttatchedObjects[playerid][prZ][8], PlayerAttatchedObjects[playerid][psX][8], PlayerAttatchedObjects[playerid][psY][8], PlayerAttatchedObjects[playerid][psZ][8]);
PlayerAttatchedObjects[playerid][pUsingSlot][8] = 1;
GameTextForPlayer(playerid, "Dodatek Założony", 1200, 3);
}
else
{
RemovePlayerAttachedObject(playerid, 8);
PlayerAttatchedObjects[playerid][pUsingSlot][8] = 0;
SendClientMessage(playerid, -1, "{0BDDC4}[Obiekty]{FFFFFF} Dodatek usunięty!");
}
SavePObjects(playerid, 8);
}
case 9:
{
if(PlayerAttatchedObjects[playerid][pUsingSlot][9] == 0)
{
SetPlayerAttachedObject(playerid, 9, PlayerAttatchedObjects[playerid][pmodel][9], PlayerAttatchedObjects[playerid][pbone][9], PlayerAttatchedObjects[playerid][pfX][9], PlayerAttatchedObjects[playerid][pfY][9], PlayerAttatchedObjects[playerid][pfZ][9],
PlayerAttatchedObjects[playerid][prX][9], PlayerAttatchedObjects[playerid][prY][9], PlayerAttatchedObjects[playerid][prZ][9], PlayerAttatchedObjects[playerid][psX][9], PlayerAttatchedObjects[playerid][psY][9], PlayerAttatchedObjects[playerid][psZ][9]);
PlayerAttatchedObjects[playerid][pUsingSlot][9] = 1;
GameTextForPlayer(playerid, "Dodatek Założony", 1200, 3);
}
else
{
RemovePlayerAttachedObject(playerid, 9);
PlayerAttatchedObjects[playerid][pUsingSlot][9] = 0;
SendClientMessage(playerid, -1, "{0BDDC4}[Obiekty]{FFFFFF} Dodatek usunięty!");
}
SavePObjects(playerid, 9);
}
}
}
}
return 0;
}
your command is fine , no way to say"unknown command". may be problem is another.