Log Making
#1

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 !
Reply
#2

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
Reply
#3

i hope you helped me too
Reply
#4

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

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

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

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

Anyone?
Reply
#9

Write a new line in the file.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)