Last Commands
#5

Quote:
Originally Posted by DobbysGamertag
Посмотреть сообщение
I'm not too sure, I use SendMessageToAdmins and SaveIn, I format a string, then when they enter any command, it saves. Does your code compile?


Edit:
pawn Код:
forward SaveIn(filename[],text[]);

public SaveIn(filename[],text[])
{
    new File:Lfile;
    new filepath[256];
    new string[256];
    new year,month,day;
    new hour,minute,second;

    getdate(year,month,day);
    gettime(hour,minute,second);
    format(filepath,sizeof(filepath),"PATHHERE/%s.txt",filename);//save it as %s.txd
    Lfile = fopen(filepath,io_append);
    format(string,sizeof(string),"[%02d/%02d/%02d | %02d:%02d:%02d] %s\r\n",day,month,year,hour,minute,second,text);
    fwrite(Lfile,string);
    fclose(Lfile);
    return 1;
}
Here's my OnPlayerCommand:

pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if(!success) SendClientMessage(playerid,bad,"Incorrect command, type /cmds to find out available commands");
    if(WatchList[playerid]  >= 1)
    {
        new string[124];
        format(string, sizeof(string),"[WATCHLIST]%s entered command %s",pName(playerid),cmdtext);
        SendMessageToAdmins(connect,string);
    }
    else if(WatchList[playerid] <= 0)
    {
        new string[124];
        format(string, sizeof(string),"%s entered command %s",pName(playerid),cmdtext);
        SaveIn("EnteredCommands",string);
    }
    return 1;
}
Understand how i've done it?
Yup it does compiles, but what I try to do is show the admin who is spectating a player, to see its lasts commands so we can check if they spammed, insulted, metagamed etc
Reply


Messages In This Thread
Last Commands - by Stefand - 01.06.2013, 07:08
Re: Last Commands - by DobbysGamertag - 01.06.2013, 07:22
Re: Last Commands - by Stefand - 01.06.2013, 07:37
Re: Last Commands - by DobbysGamertag - 01.06.2013, 07:41
Re: Last Commands - by Stefand - 01.06.2013, 07:47
Re: Last Commands - by Stefand - 01.06.2013, 08:04

Forum Jump:


Users browsing this thread: 1 Guest(s)