Report problem
#14

pawn Код:
public AddReportToken(playerid) {
    new
        sz_FileStr[32 + MAX_PLAYER_NAME],
        sz_playerName[MAX_PLAYER_NAME],
        i_timestamp[3],
        File: fPointer;

    GetPlayerName(playerid, sz_playerName, MAX_PLAYER_NAME);
    getdate(i_timestamp[0], i_timestamp[1], i_timestamp[2]);

    format(sz_FileStr, sizeof(sz_FileStr), "admins/rtokens/%s[%d'%d'%d]", sz_playerName, i_timestamp[1], i_timestamp[2], i_timestamp[0]);
    if(fexist(sz_FileStr))
    {
        fPointer = fopen(sz_FileStr, io_read);
        fread(fPointer, sz_playerName), fclose(fPointer);

        new
            i_tokenVal = strval(sz_playerName);

        format(sz_playerName, sizeof(sz_playerName), "%i", i_tokenVal + 1);
        fPointer = fopen(sz_FileStr, io_write);
        fwrite(fPointer, sz_playerName);
        fclose(fPointer);
    }
    else {
        fPointer = fopen(sz_FileStr, io_write);
        fwrite(fPointer, "1");
    }
    return fclose(fPointer);
}
i missed one but now i got it!


pawn Код:
public SeeReportToken(playerid,name[],month,day,year)
{
    new string[128], rtoken;
    new strFromFile[128];
    format(string,sizeof(string),"admins/rtokens/%s[%d'%d'%d]",name,month,day,year);
    if(fexist(string))
    {
        new File: file = fopen(string, io_read);
        if(file)
        {
            fread(file, strFromFile);
            fclose(file);

            rtoken = strval(strFromFile);
            format(string,sizeof(string),"Admin has %d report tokens on [%d/%d/%d].",rtoken,month,day,year);
            SendClientMessageEx(playerid, COLOR_YELLOW, string);
        }
    }
    else
    {
        SendClientMessageEx(playerid, COLOR_YELLOW, "Admin does not have any logged report tokens for this date.");
        return 0;
    }
    return 1;
}
i think thats what you need!
Reply


Messages In This Thread
Report problem - by WG Chinn - 17.08.2011, 00:10
Re: Report problem - by mprofitt - 17.08.2011, 00:12
Re: Report problem - by dowster - 17.08.2011, 00:16
Re: Report problem - by WG Chinn - 17.08.2011, 00:20
Re: Report problem - by farris - 17.08.2011, 00:37
Re: Report problem - by WG Chinn - 17.08.2011, 00:44
Re: Report problem - by farris - 17.08.2011, 00:55
Re: Report problem - by WG Chinn - 17.08.2011, 00:56
Re: Report problem - by ElieJabbour - 17.08.2011, 02:15
Re: Report problem - by dowster - 17.08.2011, 02:28
Re: Report problem - by WG Chinn - 17.08.2011, 15:29
Re: Report problem - by WG Chinn - 17.08.2011, 17:42
Re: Report problem - by dowster - 17.08.2011, 17:52
Re: Report problem - by WG Chinn - 17.08.2011, 17:59
Re: Report problem - by WG Chinn - 17.08.2011, 20:40
Re: Report problem - by dowster - 17.08.2011, 22:28

Forum Jump:


Users browsing this thread: 1 Guest(s)