Sending reports to a .txt file in my database. -
Goldino - 21.02.2013
Hey guys, I am currently making my admin system. I have a report command, and I want all the reports to be sent to a .txt file in my database. Because, if there isn't an Admin online to handle the report, I can check the file and handle it myself.
I use Y_ini. Here is my report command:
Код:
CMD:report( playerid, params[ ] )
{
new
targetid,
reason[ 128 ];
if ( sscanf( params, "us", targetid, reason ) )
return SendUsageError( playerid, "/report [Name/ID] [Reason]" );
if ( targetid == playerid )
return SendClientMessage( playerid, RED, "ERROR: {FFFFFF}You cannot report yourself." );
if ( targetid == INVALID_PLAYER_ID )
return InvalidPlayerError( playerid );
SendClientMessage( playerid, RED, "Your report has been successfully been sent to all online Administrators!" );
new
playerName[ MAX_PLAYER_NAME ],
targetName[ MAX_PLAYER_NAME ],
str[ 128 ];
GetPlayerName( playerid, playerName, MAX_PLAYER_NAME );
GetPlayerName( targetid, targetName, MAX_PLAYER_NAME );
format( str, 128, "[NEW REPORT]: %s [%d] has reported %s [%d]",
playerName, playerid, targetName, targetid );
SendMessageToAdmins( 0xFF9500FF, str );
format( str, 128, "Report reason: %s", reason );
SendMessageToAdmins( 0xFF9500FF, str );
return 1;
}
Please help!
Re: Sending reports to a .txt file in my database. -
Goldino - 21.02.2013
Help?
Re: Sending reports to a .txt file in my database. -
Jay_ - 21.02.2013
You don't necessarily have to use Y_Ini for such a simple task. You can use the fwrite native.
See
https://sampwiki.blast.hk/wiki/Fwrite for some examples.
Re: Sending reports to a .txt file in my database. -
Rock - 21.02.2013
Or use
this.
Even more easy.
Re: Sending reports to a .txt file in my database. -
Goldino - 21.02.2013
But how do i use fwrite and store reports in it? Plz answer
Re: Sending reports to a .txt file in my database. -
Jay_ - 21.02.2013
There is a perfectly good example provided on the wiki. There are also
many examples on these forums. If you are to learn anything you need to stop being lazy and do some research.
Re: Sending reports to a .txt file in my database. -
Goldino - 21.02.2013
Quote:
Originally Posted by Jay_
There is a perfectly good example provided on the wiki. There are also many examples on these forums. If you are to learn anything you need to stop being lazy and do some research.
|
Your attitude against me is disgusting! You are not helping me, it only has 1 example of fwrite. Can you give me an example
Re: Sending reports to a .txt file in my database. -
tyler12 - 21.02.2013
if(!fexist("Reports.txt)) return 0;
new File:File = fopen("Reports.txt",io_append);
fwrite(File,"SomeText");
fclose(File);
Re: Sending reports to a .txt file in my database. -
Scenario - 21.02.2013
Yes, and he also said this:
Quote:
Originally Posted by Jay_
There are also many examples on these forums.
|
Quit making a new thread for every single problem you encounter.