use inputtext for enum - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: use inputtext for enum (
/showthread.php?tid=439754)
Please help me! -
nielsbon1 - 26.05.2013
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!
Re: use inputtext for enum -
Hernando - 26.05.2013
Here's the mistake:
pawn Код:
eventsInfo[eName] = inputtext[128];
change it to:
pawn Код:
format(eventsInfo[eName], 128, "%s", inputtext);