CMD:bug(playerid, params[])
{
new pID, text[64];
if(sscanf(params, "s[64]", text)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /bug (bug)");
new bug[256];
format(bug, sizeof bug, "%s Has Reported A Bug. Description: %s", PlayerName(pID), text);
new file[256];
format(file, sizeof file, "DM/Reports/Bugs.txt", text);
if(!dini_Exists("DM/Reports/Bugs.txt")) dini_Create("DM/Reports/Bugs.txt");
return 1;
}
cmd:bug(playerid,params[])
{
new text[256];
if(sscanf(params, "s", text)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /bug (bug)");
new bug[256];
format(bug, sizeof bug, "%s Has Reported A Bug. Description: %s", PlayerName(pID), text);
//I think u want to send this sentence ^ to the admins :D so just add 1 more sendclientmessage
SendClientMessage(playerid,COLOR_RED,"Thank you for reporting a Bug");
new
File:lFile = fopen("Bugs.txt", io_append),
logData[250],
fyear, fmonth, fday,
fhour, fminute, fsecond;
getdate(fyear, fmonth, fday);
gettime(fhour, fminute, fsecond);
format(logData, sizeof(logData),"[%02d/%02d/%04d %02d:%02d:%02d] %s: %s \r\n", fday, fmonth, fyear, fhour, fminute, fsecond, getPlayerName(playerid), text);
fwrite(lFile, logData);
fclose(lFile);
return 1;
}
Why u copy other stuff and give me? i want to try to fix mine code
|
CMD:bug(playerid, params[])
{
if (isnull(params)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /bug (bug)");
new bug[128], File: fhandle = fopen("DM/Reports/Bugs.txt", io_append);
format(bug, sizeof (bug), "By %s: %s\r\n", PlayerName(playerid), params);
if (fhandle)
{
fwrite(fhandle, bug);
fclose(fhandle);
}
else SendClientMessage(playerid, COLOR_RED, "The file couldn't be opened. Try again later!");
return 1;
}
CMD:bug(playerid, params[])
{ new pID, text[64]; if(sscanf(params, "s[64]", text)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /bug (bug)"); new bug[256]; format(bug, sizeof bug, "%s Has Reported A Bug. Description: %s", PlayerName(pID), text); new file[256]; format(file, sizeof file, "DM/Reports/Bugs.txt", text); if(!dini_Exists(file)) dini_Create(file); return 1; } |
This creates the file inside there but it dont write the text inside the file....
|