Attachment System Dialog Issue.
#1

Hello everyone,

Basically, my dialog for my attachment system is giving me a bit of a headache and I was wondering how to approach it. This system is just the default attachment modification filterscript with a saving system attached to it. I was wondering how I could fix this issue at all.



It stops at HardHat3 and just says {F3 afterwards, and there is quite a bit more selection options after HardHat3.

pawn Код:
if(dialogid == DIALOG_ATTACH_INDEX_SELECTION)
    {
        if(response)
        {
            if(IsPlayerAttachedObjectSlotUsed(playerid, listitem))
            {
                ShowPlayerDialog(playerid, DIALOG_ATTACH_EDITREPLACE, DIALOG_STYLE_MSGBOX, \
                ""COL_GREEN"Attachment Modification", "Do you wish to edit the attachment in that slot, or delete it?", "Edit", "Delete");
            }
            else
            {
                new string[4000+1];
                for(new x;x<sizeof(AttachmentObjects);x++)
                {
                    format(string, sizeof(string), "%s"COL_YELLOW"%s\n", string, AttachmentObjects[x][attachname]);
        }
                ShowPlayerDialog(playerid, DIALOG_ATTACH_MODEL_SELECTION, DIALOG_STYLE_LIST, ""COL_GREEN"Attachments - Model Selection", string, "Select", "Cancel");
            }
            SetPVarInt(playerid, "AttachmentIndexSel", listitem);
         }
        return 1;
    }
pawn Код:
{19141, "SWATHelmet1"},
{19142, "SWATArmour1"},
{19160, "HardHat3"},
{19161, "PoliceHat1"},
{19162, "PoliceHat2"},
{19163, "GimpMask1"},
{19317, "bassguitar01"},
{19318, "flyingv01"},
{19319, "warlock01"},
{19330, "fire_hat01"},
{19331, "fire_hat02"},
{19346, "hotdog01"},
{19347, "badge01"},
{19348, "cane01"},
{19349, "monocle01"},
{19350, "moustache01"},
{19351, "moustache02"},
{19352, "tophat01"},
{19487, "tophat02"},
{19488, "HatBowler6"},
{19513, "whitephone"},
{19578, "Banana"},
{19418, "HandCuff"}
How should I approach this? Any help is appreciated!
Reply
#2

Quote:
Originally Posted by Trevor19012
Посмотреть сообщение
Hello everyone,

Basically, my dialog for my attachment system is giving me a bit of a headache and I was wondering how to approach it. This system is just the default attachment modification filterscript with a saving system attached to it. I was wondering how I could fix this issue at all.



It stops at HardHat3 and just says {F3 afterwards, and there is quite a bit more selection options after HardHat3.

pawn Код:
if(dialogid == DIALOG_ATTACH_INDEX_SELECTION)
    {
        if(response)
        {
            if(IsPlayerAttachedObjectSlotUsed(playerid, listitem))
            {
                ShowPlayerDialog(playerid, DIALOG_ATTACH_EDITREPLACE, DIALOG_STYLE_MSGBOX, \
                ""COL_GREEN"Attachment Modification", "Do you wish to edit the attachment in that slot, or delete it?", "Edit", "Delete");
            }
            else
            {
                new string[4000+1];
                for(new x;x<sizeof(AttachmentObjects);x++)
                {
                    format(string, sizeof(string), "%s"COL_YELLOW"%s\n", string, AttachmentObjects[x][attachname]);
        }
                ShowPlayerDialog(playerid, DIALOG_ATTACH_MODEL_SELECTION, DIALOG_STYLE_LIST, ""COL_GREEN"Attachments - Model Selection", string, "Select", "Cancel");
            }
            SetPVarInt(playerid, "AttachmentIndexSel", listitem);
         }
        return 1;
    }
pawn Код:
{19141, "SWATHelmet1"},
{19142, "SWATArmour1"},
{19160, "HardHat3"},
{19161, "PoliceHat1"},
{19162, "PoliceHat2"},
{19163, "GimpMask1"},
{19317, "bassguitar01"},
{19318, "flyingv01"},
{19319, "warlock01"},
{19330, "fire_hat01"},
{19331, "fire_hat02"},
{19346, "hotdog01"},
{19347, "badge01"},
{19348, "cane01"},
{19349, "monocle01"},
{19350, "moustache01"},
{19351, "moustache02"},
{19352, "tophat01"},
{19487, "tophat02"},
{19488, "HatBowler6"},
{19513, "whitephone"},
{19578, "Banana"},
{19418, "HandCuff"}
How should I approach this? Any help is appreciated!
Increase the array of the variable used to format the string called 'string'
Reply
#3

variable[10000]
Reply
#4

Quote:
Originally Posted by rfr
Посмотреть сообщение
variable[10000]
No, there are limits my dude.

https://sampwiki.blast.hk/wiki/Limits

For dialogs, Info (Main text) is 4096. If your array is that big, you'll have to setup pages for your buy menu.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)