use inputtext for enum
#1

Hey guys,

I am trying to use the inputtext at onDialogResponse to set a event name, however it does not work for some reason, we are trying the following:

pawn Код:
enum _:eEvent {
    eID,                            /* Event ID */
    eName[128],                     /* Event Name */
    eType,                          /* Event Type */
    ePrice,                         /* Event Price */
    ePass[250],                     /* Password Protected */
    eMaxPlayers,                    /* The amount of max players */
};

new eventsInfo[eEvent];

case DIALOG_EVENTNAME: {
        if(!response) {
                SendClientMessage(playerid, COLOR_RED, "(Aborted!) You aborted the event!");
                return 1;
            }
    eventsInfo[eName] = inputtext[128];
            new string[250];
            format(string, sizeof(string), "(Succes!) You have succesfully added the name %s to the event!", eventsInfo[eName]);
            SendClientMessage(playerid, COLOR_GREEN, string);
            Dialog_Show(playerid, DIALOG_EVENTTYPE);
            return 1;
        }
If we insert a name and press submit then nothing will appear and it will stop showing the next dialog.

Thanks in advance!
Reply
#2

Here's the mistake:
pawn Код:
eventsInfo[eName] = inputtext[128];
change it to:
pawn Код:
format(eventsInfo[eName], 128, "%s", inputtext);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)