SA-MP Forums Archive
filesave: /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: filesave: /report (/showthread.php?tid=100295)



filesave: /report - mike25620 - 04.10.2009

if(strcmp(cmd, "/report", true) == 0)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
tmp = strtok(cmdtext, idx);
new targetid = ReturnUser(tmp);
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))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /report [playerid/PartOfName] [reason]");
return 1;
}
GetPlayerName(targetid, giveplayername, sizeof(giveplayername));
format(string, sizeof(string), "%s Reports : %s [reason: %s ]", sendername,giveplayername,(result));
ABroadCast(COLOR_YELLOW,string,1);
SendClientMessage(playerid, COLOR_YELLOW, "Your Report Message was sent to the Admins.");
}
return 1;
}



I have this but i want to have it save to a .txt file in the folder


Re: filesave: /report - Kwarde - 11.01.2010

Do something with:

Quote:

new File:abuselog = fopen("/Logs/abuselog.txt", io_append);
format(string,sizeof string, "format(string, sizeof(string), "%s Reports : %s [reason: %s ]:", sendername,giveplayername,(result));
fwrite(abuselog,string);
fclose(abuselog);

(BTW I don't know when you maked this topic, so it can that this is a late reaction);

Gvm (means: Groeten Van Mij(dutch, in english: Greetings From Me xD))


Re: filesave: /report - KnooL - 11.01.2010

nice bumping...

October 04, 2009, 06:26:41 ยป