[Help] Bug Report
#1

I done a script witch players can report a bug to admins, with the command : "/Bug".

The script works perfectly, but.. i want that it will save the report to some file.. is it possible?

Here is the script if you need...

Код:
  forward SendBugReportToAdmins(color,const string[],adminlvl);
Код:
 	  if (strcmp(cmd, "/BUG", true) == 0) // SEND BUG TO ADMINS
	  {
	    new string[256], Name[MAX_PLAYER_NAME];
	    GetPlayerName(playerid, Name, sizeof(Name));

  		  new length = strlen(cmdtext);
		  while ((idx < length) && (cmdtext[idx] <= ' '))
	  	{
	  		idx++;
	  	}
	  	new offset = idx;
	  	new result[64];
	  	while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
	  	{
	  		result[idx - offset] = cmdtext[idx];
			idx++;
  		}
	  	result[idx - offset] = EOS;

	  	if (!strlen(result)) return SendClientMessage(playerid, WHITEBLUE, "USE: /BUG [Description]");
	   	format(string, sizeof(string), "%s: Report a Bug: %s", Name, result);
      SendBugReportToAdmins(LIGHTBLUE, string, 1);
      return 1;
	  }
Код:
 public SendBugReportToAdmins(color,const string[],adminlvl)
{
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i))
		{
			if (PlayerInfo[i][Admin] > 0 && PlayerInfo[i][Report] == 1)
		  SendClientMessage(i, color, string);
		}
	}
	return 1;
}
Reply
#2

Yes, it's possilble. You could use dini to something like that.
Reply
#3

or look at pen1 script and see how it writes stuff to a file and do it similair way. to ADD stuff to a file it's io_append. ;]
Reply
#4

thx.. works =]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)