Where does this save/show?
#1

Hello guys.
I was looking around in ravens rp and i saw this
pawn Код:
if(strcmp(cmd, "/bug", true) == 0 || strcmp(cmd, "/suggestion", true) == 0) // Modded By CuervO_NegrO
    {
        if(IsPlayerConnected(playerid))
        {
            new length = strlen(cmdtext);
            while ((idx < length) && (cmdtext[idx] <= ' '))
            {
                idx++;
            }
            new offset = idx;
            new result[128];
            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: (/bug [bug report]");
                return 1;
            }
            new y,m,d;
            new h,mi,s;
            getdate(y,m,d);
            gettime(h,mi,s);
            format(string, sizeof(string),"(%d/%d/%d)[%d:%d:%d] Bug Report of %s: %s",d,m,y,h,mi,s,sendername, (result));
            BugsLog(string);
        }
        return 1;
    }
Could anyone of you tell me where it saves or is being shown for the scripter? I cant seem to see anything that tells the scripter that someone reported a suggesstion/bug that he can see ingame?
Reply
#2

It saves in the bug.log file under scriptfiles -> LARP -> Logs







Please REP me if I was able to help you
Reply
#3

Yes but i mean thats the only place right? there is nothing so the scripter can check it ingame?
and how can i make it save like the reports so the scripter can check it later ingame with example /bugs?
Reply
#4

Well you could do a few things:

1.) Send a message to On-Line Admins when the bug is reported.
2.) Have a command open the log IG and send it as a message. (Would require alot of scripting).
Reply
#5

Would this work? (Cant try it out so asking you for now)

pawn Код:
#define MAX_BUGS 9 // on top
new Suggestions[MAX_BUGS][128]; // top

public BugsLog(string[])
{
    new entry[256];
    format(entry, sizeof(entry), "%s\r\n",string);
    new File:hFile;
    hFile = fopen("LARP/Logs/bugs.log", io_append);
    fwrite(hFile, entry);
    fclose(hFile);
}

    for(new i = 1; i < MAX_BUGS; i++) Suggestions[i] = "<none>";// OnGameModeInit
// And then the command
    if(strcmp(cmd, "/bugs", true) == 0)
    {
        if(PlayerInfo[playerid][pAdmin] >= 1)
        {
            new SuggestionCount;
            for(new i = 1; i < MAX_BUGS; i++)
            {
                if(strcmp( Suggestions[i], "<none>", true) != 0) { SuggestionCount++; SendClientMessage(playerid, COLOR_GRAD3, "Last Nine Bugs/Suggestions:"); SendClientMessage(playerid,COLOR_GRAD1,Suggestions[i]); }
            }
            if(SuggestionCount == 0)
            {
                SendClientMessage(playerid,COLOR_GRAD1," There have been no reports of bugs or any suggestions");
            }
        }
        else
        {
            SendClientMessage(playerid,COLOR_GRAD1,"ERROR: You are not Authorized to use This Command!");
        }
        return 1;
    }
Still noob in scripting in my opinion so please point out if i made some misstakes
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)