Problem
#1

Hai,

I've been brave and had an attempt to create an organization system. I've basicly got it up as a dialog, and when I type "/createorg", a dialog opens up, I have to type in that dialog the organization name.

Then I have set it so it saves the organization name in a file, but I don't know how to get the name, i've tried "inputtext" but that doesnt work.

Hes my code.

/createorg command
pawn Код:
dcmd_createorg(playerid, params[])
{
    if(PlayerInfo[playerid][AdminLevel] < 4) return 0;
    {
        ShowPlayerDialog(playerid, DIALOG_CREATEORG, DIALOG_STYLE_INPUT, "Organization Creation | Name", "Please enter the new organization name", "Next", "Close");
    }
    #pragma unused params
    return 1;
}
Heres the dialog response
pawn Код:
if(dialogid == DIALOG_CREATEORG)
    {
        new oFile[128];
        format(oFile, sizeof(oFile), OrganizationLocation, inputtext);
        if(!strlen(inputtext))
        {
            ShowPlayerDialog(playerid, DIALOG_CREATEORG, DIALOG_STYLE_INPUT, "Organization Creation | Name", "Please enter the new organization name", "Next", "Close");
            SendClientMessage(playerid, COLOR_RED, "~ You need to choose an organization name.");
        }
        if(dini_Exists(inputtext))
        {
            ShowPlayerDialog(playerid, DIALOG_CREATEORG, DIALOG_STYLE_INPUT, "Organization Creation | Name", "Please enter the new organization name", "Next", "Close");
            SendClientMessage(playerid, COLOR_RED, "~ There is already an organization with this name.");
        }
        if(!dini_Exists(inputtext))
        {
            dini_Create(inputtext);
            dini_IntSet(oFile, "Organization Name", pOrganization[playerid][Name] = HERE);     
}
    }
I do have "Enums" but there is only one.

If you see where it says "HERE" next to "dini_IntSet(oFile, "Organization Name", pOrganization[playerid][Name]". How do I make it so the line saves as the organization name.
Reply
#2

dini_Set instead of dini_IntSet?
Reply
#3

Still doesn't work, give's me the error "error 006: must be assigned to an array"
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)