Sending reports to a .txt file in my database.
#1

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!
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)