That's it? It doesn't really give us that much information to work on.
Код:
if((dialogid == EDITTOYS) && response)
{
/*new toycount = GetFreeToySlot(playerid);
if(toycount >= 10) return SendClientMessageEx(playerid, COLOR_GRAD1, "You currently have 10 objects attached, please deattach an object.");*/
if(listitem >= GetPlayerToySlots(playerid))
{
new szstring[128];
SetPVarInt(playerid, "MiscShop", 8);
format(szstring, sizeof(szstring), "Additional Toy Slot\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[28][sItemPrice]), number_format(PlayerInfo[playerid][pCredits]-ShopItems[28][sItemPrice]));
return ShowPlayerDialog(playerid, DIALOG_MISCSHOP2, DIALOG_STYLE_MSGBOX, "Additional Toy Slot", szstring, "Purchase", "Cancel");
}
else if(PlayerToyInfo[playerid][listitem][ptModelID] == 0 && listitem < GetPlayerToySlots(playerid))
{
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Edit your toy", "Woops! You don't have anything to edit in that slot.", "Okay", "");
}
else
{
2981 SendClientMessageEx(playerid, COLOR_WHITE, "{AA3333}HINT:{FFFF00} Position your camera differently to better see where your editing.");
SetPVarInt(playerid, "ToySlot", listitem);
ShowEditMenu(playerid);
}
}
I think you misunderstood me. What I needed was the code of dialog = 2981, and not the line number.
It seems that your script has defined dialog ids, so search between your defines for a
Код:
case DIALOG_ADCATEGORY: if(response) switch(listitem) {
case 0: {
new
szDialog[2256],
szBuffer[32],
arrAdverts[MAX_PLAYERS] = INVALID_PLAYER_ID,
iDialogCount,
iCount,
iBreak,
iRand;
for(new x; x < 50; ++x) ListItemTrackId[playerid][x] = -1;
foreach(new i: Player)
{ if(!isnull(szAdvert[i])) arrAdverts[iCount++] = i; }
while(iDialogCount < 50 && iBreak < 500) {
iRand = random(iCount);
if(arrAdverts[iRand] != INVALID_PLAYER_ID) {
if(AdvertType[arrAdverts[iRand]] == 1) //Real Estate
{
strcpy(szBuffer, szAdvert[arrAdverts[iRand]], sizeof(szBuffer));
if(PlayerInfo[playerid][pAdmin] <= 1) format(szDialog, sizeof(szDialog), "%s%s... (%i)\r\n", szDialog, szBuffer, PlayerInfo[arrAdverts[iRand]][pPnumber]);
else format(szDialog, sizeof(szDialog), "%s%s... (%s)\r\n", szDialog, szBuffer, GetPlayerNameEx(arrAdverts[iRand]));
ListItemTrackId[playerid][iDialogCount++] = arrAdverts[iRand];
arrAdverts[iRand] = INVALID_PLAYER_ID;
}
}
++iBreak;
}
if(!isnull(szDialog)) return ShowPlayerDialog(playerid, DIALOG_ADLIST, DIALOG_STYLE_LIST, "Advertisements - List", szDialog, "Select", "Return");
ShowPlayerDialog(playerid, DIALOG_ADCATEGORY, DIALOG_STYLE_LIST, "Advertisements Categories", "Real Estate\nAutomobile\nBuying\nSelling\nMiscellaneous", "Select", "Cancel");
SendClientMessage(playerid, COLOR_GREY, "No advertisements have been posted.");
}
case 1: {
new
szDialog[2256],
szBuffer[32],
arrAdverts[MAX_PLAYERS] = INVALID_PLAYER_ID,
iDialogCount,
iCount,
iBreak,
iRand;
for(new x; x < 50; ++x) ListItemTrackId[playerid][x] = -1;
foreach(new i: Player)
{ if(!isnull(szAdvert[i])) arrAdverts[iCount++] = i; }
while(iDialogCount < 50 && iBreak < 500) {
iRand = random(iCount);
if(arrAdverts[iRand] != INVALID_PLAYER_ID) {
if(AdvertType[arrAdverts[iRand]] == 2) //Automobile
{
strcpy(szBuffer, szAdvert[arrAdverts[iRand]], sizeof(szBuffer));
if(PlayerInfo[playerid][pAdmin] <= 1) format(szDialog, sizeof(szDialog), "%s%s... (%i)\r\n", szDialog, szBuffer, PlayerInfo[arrAdverts[iRand]][pPnumber]);
else format(szDialog, sizeof(szDialog), "%s%s... (%s)\r\n", szDialog, szBuffer, GetPlayerNameEx(arrAdverts[iRand]));
ListItemTrackId[playerid][iDialogCount++] = arrAdverts[iRand];
arrAdverts[iRand] = INVALID_PLAYER_ID;
}
}
++iBreak;
}
if(!isnull(szDialog)) return ShowPlayerDialog(playerid, DIALOG_ADLIST, DIALOG_STYLE_LIST, "Advertisements - List", szDialog, "Select", "Return");
ShowPlayerDialog(playerid, DIALOG_ADCATEGORY, DIALOG_STYLE_LIST, "Advertisements Categories", "Real Estate\nAutomobile\nBuying\nSelling\nMiscellaneous", "Select", "Cancel");
SendClientMessage(playerid, COLOR_GREY, "No advertisements have been posted.");
}
case 2: {
new
szDialog[2256],
szBuffer[32],
arrAdverts[MAX_PLAYERS] = INVALID_PLAYER_ID,
iDialogCount,
iCount,
iBreak,
iRand;
for(new x; x < 50; ++x) ListItemTrackId[playerid][x] = -1;
foreach(new i: Player)
{ if(!isnull(szAdvert[i])) arrAdverts[iCount++] = i; }
while(iDialogCount < 50 && iBreak < 500) {
iRand = random(iCount);
if(arrAdverts[iRand] != INVALID_PLAYER_ID) {
if(AdvertType[arrAdverts[iRand]] == 3) //Buying
{
strcpy(szBuffer, szAdvert[arrAdverts[iRand]], sizeof(szBuffer));
if(PlayerInfo[playerid][pAdmin] <= 1) format(szDialog, sizeof(szDialog), "%s%s... (%i)\r\n", szDialog, szBuffer, PlayerInfo[arrAdverts[iRand]][pPnumber]);
else format(szDialog, sizeof(szDialog), "%s%s... (%s)\r\n", szDialog, szBuffer, GetPlayerNameEx(arrAdverts[iRand]));
ListItemTrackId[playerid][iDialogCount++] = arrAdverts[iRand];
arrAdverts[iRand] = INVALID_PLAYER_ID;
}
}
++iBreak;
}
if(!isnull(szDialog)) return ShowPlayerDialog(playerid, DIALOG_ADLIST, DIALOG_STYLE_LIST, "Advertisements - List", szDialog, "Select", "Return");
ShowPlayerDialog(playerid, DIALOG_ADCATEGORY, DIALOG_STYLE_LIST, "Advertisements Categories", "Real Estate\nAutomobile\nBuying\nSelling\nMiscellaneous", "Select", "Cancel");
SendClientMessage(playerid, COLOR_GREY, "No advertisements have been posted.");
}
case 3: {
new
szDialog[2256],
szBuffer[32],
arrAdverts[MAX_PLAYERS] = INVALID_PLAYER_ID,
iDialogCount,
iCount,
iBreak,
iRand;
for(new x; x < 50; ++x) ListItemTrackId[playerid][x] = -1;
foreach(new i: Player)
{ if(!isnull(szAdvert[i])) arrAdverts[iCount++] = i; }
while(iDialogCount < 50 && iBreak < 500) {
iRand = random(iCount);
if(arrAdverts[iRand] != INVALID_PLAYER_ID) {
if(AdvertType[arrAdverts[iRand]] == 4) //Selling
{
strcpy(szBuffer, szAdvert[arrAdverts[iRand]], sizeof(szBuffer));
if(PlayerInfo[playerid][pAdmin] <= 1) format(szDialog, sizeof(szDialog), "%s%s... (%i)\r\n", szDialog, szBuffer, PlayerInfo[arrAdverts[iRand]][pPnumber]);
else format(szDialog, sizeof(szDialog), "%s%s... (%s)\r\n", szDialog, szBuffer, GetPlayerNameEx(arrAdverts[iRand]));
ListItemTrackId[playerid][iDialogCount++] = arrAdverts[iRand];
arrAdverts[iRand] = INVALID_PLAYER_ID;
}
}
++iBreak;
}
if(!isnull(szDialog)) return ShowPlayerDialog(playerid, DIALOG_ADLIST, DIALOG_STYLE_LIST, "Advertisements - List", szDialog, "Select", "Return");
ShowPlayerDialog(playerid, DIALOG_ADCATEGORY, DIALOG_STYLE_LIST, "Advertisements Categories", "Real Estate\nAutomobile\nBuying\nSelling\nMiscellaneous", "Select", "Cancel");
SendClientMessage(playerid, COLOR_GREY, "No advertisements have been posted.");
}
case 4: {
new
szDialog[2256],
szBuffer[32],
arrAdverts[MAX_PLAYERS] = INVALID_PLAYER_ID,
iDialogCount,
iCount,
iBreak,
iRand;
for(new x; x < 50; ++x) ListItemTrackId[playerid][x] = -1;
foreach(new i: Player)
{ if(!isnull(szAdvert[i])) arrAdverts[iCount++] = i; }
while(iDialogCount < 50 && iBreak < 500) {
iRand = random(iCount);
if(arrAdverts[iRand] != INVALID_PLAYER_ID) {
if(AdvertType[arrAdverts[iRand]] == 5) //Miscellaneous
{
strcpy(szBuffer, szAdvert[arrAdverts[iRand]], sizeof(szBuffer));
if(PlayerInfo[playerid][pAdmin] <= 1) format(szDialog, sizeof(szDialog), "%s%s... (%i)\r\n", szDialog, szBuffer, PlayerInfo[arrAdverts[iRand]][pPnumber]);
else format(szDialog, sizeof(szDialog), "%s%s... (%s)\r\n", szDialog, szBuffer, GetPlayerNameEx(arrAdverts[iRand]));
ListItemTrackId[playerid][iDialogCount++] = arrAdverts[iRand];
arrAdverts[iRand] = INVALID_PLAYER_ID;
}
}
++iBreak;
}
if(!isnull(szDialog)) return ShowPlayerDialog(playerid, DIALOG_ADLIST, DIALOG_STYLE_LIST, "Advertisements - List", szDialog, "Select", "Return");
ShowPlayerDialog(playerid, DIALOG_ADCATEGORY, DIALOG_STYLE_LIST, "Advertisements Categories", "Real Estate\nAutomobile\nBuying\nSelling\nMiscellaneous", "Select", "Cancel");
SendClientMessage(playerid, COLOR_GREY, "No advertisements have been posted.");
}
}