Chat Log?
#1

Ok, i just made a super basic chat log. The code is pretty decent. BUT, i get this error:

F:\dmserver\filterscripts\chatlog.pwn(20) : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Warning.

CODE:

pawn Код:
#include <a_samp>
#include <file>
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
    print("CHATLOG");
    return 1;
}

#else
main()
{
    print("Made BY: MATT");
}

#endif
public OnPlayerText(playerid, text[])
{
new File:chatlog = fopen("/logs/ChatLog.txt",io_append),chat[128],chater[128],hour,minute,second;
    GetPlayerName(playerid,chater,sizeof(chater));
    gettime(hour,minute,second);
    format(chat,sizeof(chat),"[%d:%d:%d]: ( %s ): %s\n",hour,minute,second,chater,text);
    if(chatlog)
    {
        if(fexist("chatlog.txt"))
        {
            fwrite(chatlog,chat);
            fclose(chatlog);
        }
    }
    return 1;
}
What should i do
Reply
#2

Please use [ pawn ] [ /pawn ] tags so we can read the code and know which line is wrongly idented.
Reply
#3

done
Reply
#4

It's very obvious.
pawn Код:
new File:chatlog = fopen("/logs/ChatLog.txt",io_append),chat[128],chater[128],hour,minute,second;
It's unidented, add a tab space to it.
Reply
#5

ok. ill try that. fixed it! THANK YOU SOOOOOOOOO MUCH!!!!!!!!!!!!!!!!!!!!!!!
Reply
#6

ok, now it wont write to the file. i ut it in my gamemode. do i need #include <file> or something? WHAT TO DO
Reply
#7

it will create the file and stuff. it just wont write to it. WHAT TO DO??
Reply
#8

Why make a chat log when you already have a server_log.txt when samp-server.exe starts?
Reply
#9

because the server log is filled with a bunch of other stuff. plus i want to learn more about scripting.
Reply
#10

Of course you've put that code from a tutorial which is bad implemented, there are others tutorials to make chatlogs tho. I can't help you now because I don't use SA-MP's file include.
Reply
#11

so what should i do? how can i do this in dini?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)