06.01.2013, 10:36
ok i made u a very easy function to use.
it saves a file called CMDLog.txt in your scriptfiles and using Y_INI
is easy to use. for example in your command above all you have to do is add this
and that will save a file called "CmdLog.txt" and will have the time that the player send the cmd and the name and the cmd he typed.
NOTE if the players spams the cmd it will overweight the last cmd by him
it saves a file called CMDLog.txt in your scriptfiles and using Y_INI
pawn Код:
stock LogPlayerCmd(playerid,cmdtext[])
{
new name[MAX_PLAYER_NAME], file[80],fStr[90],tStr[30];
GetPlayerName(playerid, name, sizeof(name));
//
new Hour, Minute, Second;
gettime(Hour, Minute, Second);
format(tStr,sizeof tStr,"[%02d:%02d:%02d]",Hour, Minute, Second);
format(fStr,sizeof fStr,"%s: %s",name,cmdtext);
//
new INI:Acc = INI_Open("CmdLog.txt");
INI_WriteString(Acc,tStr, fStr);
INI_Close(Acc);
return 1;
}
pawn Код:
LogPlayerCmd(playerid,"armour");
NOTE if the players spams the cmd it will overweight the last cmd by him