SA-MP Forums Archive
Log Making - 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: Log Making (/showthread.php?tid=65540)



Log Making - wordas - 13.02.2009

how to make a log that if player writes /Command [Text] Then it Saves The Player Nick And The Text i relly need it! please help !


Re: Log Making - Daren_Jacobson - 13.02.2009

i have never done anything with files and i am doing this in the reply box but here goes
pawn Код:
OnPlayerCommandText(playerid, cmdtext[])
{
new pName[MAX_PLAYER_NAME], stringymabobber[200]; //i hate 256
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(stringymabobber, 200, "\n%s command: %s", pName, cmdtext);
new File:commando = fopen("commands.log", io_append);
fwrite(commando, stringymabobber);
fclose(commando);
//rest of OnPlayerCommandText Here
hope i could help

edit:changed string to something else

edit2: added line break


Re: Log Making - wordas - 14.02.2009

i hope you helped me too


Re: Log Making - yom - 14.02.2009

What about players who use /register or /login commands? you will see their pass in clear text?


Re: Log Making - wordas - 14.02.2009

Why Do i get this warrning? : local variable "string" shadows a variable at a preceding level


Re: Log Making - Marcel - 14.02.2009

You have two
pawn Код:
new string[sizehere];
either rename one or delete one.


Re: Log Making - wordas - 14.02.2009

owh and how can i make that the text in log well 1command text in 1 line not 2commands in 1line


Re: Log Making - wordas - 14.02.2009

Anyone?


Re: Log Making - yom - 14.02.2009

Write a new line in the file.