if(!strcmp(cmdtext, "/cbox", true))
{
ShowPlayerDialog(playerid,30, DIALOG_STYLE_INPUT, "Server Comment Box", "Type your comment here.", "Submit", "Cancel");
return 1;
}
|
I was about to help you, but you decide to double post after 5 minutes? Learn to be patient, we aren't slaves to help you at request.
|
CMD:c(file[], input[])
{
File:filevar;
if(!fexist(file)) filevar = fopen(file, io_write);
else filevar = fopen(file, io_append);
if(!fexist(file))
{
printf("Failed to load '%s'", file);
return 0;
}
else
{
new str[512];
format(str, sizeof(str), "%s\r\n", input);
fwrite(filevar, input);
fclos(filevar);
return 1;
}
}
|
+1
DO you even know pawn code? pawn Код:
If this doesnt work wait for somone to edit it or i can make it for you in Y_INI |
forward TestLog(string[]);
#define TESTTEST 1
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/testt", cmdtext, true, 10) == 0)
{
ShowPlayerDialog(playerid,TESTTEST, DIALOG_STYLE_INPUT, "Server Comment Box", "Type your comment here.", "Submit", "Cancel");
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == TESTTEST)
{
if(response)
{
new string[120];
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
strval(inputtext);
format(string, sizeof(string), "Message sent %s %s",sendername, inputtext);
SendClientMessageToAll(COLOR_WHITE, string);
TestLog(string);
return 1;
}
}
return 1;
}
public TestLog(string[])
{
new entry[200];
format(entry, sizeof(entry), "%s\r\n",string);
new File:hFile;
hFile = fopen("testt.log", io_append);
fwrite(hFile, entry);
fclose(hFile);
}
|
I was about to help you, but you decide to double post after 5 minutes? Learn to be patient, we aren't slaves to help you at request.
|
|
Since he wants to do it with a dialog, it's actually easier to make under ondialogresponse, since it has the "inputtext" option.
|
|
Sorry I didnt read that he wanted it in dialog, Ill try to read it over again next time
|