SA-MP Forums Archive
Help with a command. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help with a command. (/showthread.php?tid=184172)



Help with a command. - Scriptissue - 18.10.2010

I made a command that when you write the command it will show you the kills logs which is stored as a INI file, now It doesn't work I don't know how to make the command read from the file, can any one check it ?
pawn Код:
if (strcmp(cmd, "/killlogs", true) ==0 )
    {
        if(IsPlayerConnected(playerid))
        {
            if(gPlayerLogged[playerid] == 1)
            {
                SendClientMessage(playerid, COLOR_WHITE, string);
                    format(string, 256, "%s's Kill Record: %s", sendername);
                return 1;
            }
            GetPlayerName(playerid, sendername, sizeof(sendername));
            format(string, sizeof(string), "Adminjail/%s.ini", sendername);
            new File: hFile = fopen(string, io_read);
            if (hFile)
            {
               
                return 1;
            }



Re: Help with a command. - LarzI - 18.10.2010

First of all, extensions are there for description only, I guess, but who use "ini" as the extension if it's a log file?
I recommend either using .log or .txt

But as I said, you can use whatever you want..

Ontopic:

Search. There are lots of topics about this already, and I think some tutorials too (including File_Functions @ wiki.sa-mp.com)


Re: Help with a command. - Scriptissue - 18.10.2010

But how can I define on the command that he will read and show the file ingame ? that's is my question what should I add ? .


Re: Help with a command. - Scriptissue - 18.10.2010

solved !!!