05.07.2009, 17:04
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...
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; }