[Help] Bug Report - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [Help] Bug Report (
/showthread.php?tid=85131)
[Help] Bug Report -
borisblat - 05.07.2009
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;
}
Re: [Help] Bug Report -
refshal - 05.07.2009
Yes, it's possilble. You could use dini to something like that.
Re: [Help] Bug Report -
Ignas1337 - 05.07.2009
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. ;]
Re: [Help] Bug Report -
borisblat - 06.07.2009
thx.. works =]