How to create comment box and save?
#8

Код:
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);
}
Tested work
Reply


Messages In This Thread
How to create comment box and save? - by HotPlayer - 28.08.2011, 21:54
Re: How to create comment box and save? - by HotPlayer - 28.08.2011, 21:59
Re: How to create comment box and save? - by Abreezy - 28.08.2011, 22:03
Re: How to create comment box and save? - by HotPlayer - 28.08.2011, 22:08
Re: How to create comment box and save? - by dreamworld - 28.08.2011, 22:22
Re: How to create comment box and save? - by IceCube! - 28.08.2011, 22:33
Re: How to create comment box and save? - by Abreezy - 28.08.2011, 22:56
Re: How to create comment box and save? - by dreamworld - 28.08.2011, 23:11
Re: How to create comment box and save? - by IceCube! - 28.08.2011, 23:13
Re: How to create comment box and save? - by Abreezy - 28.08.2011, 23:18

Forum Jump:


Users browsing this thread: 1 Guest(s)