trouble with Cmd log
#1

ive been trying to get my server to right a cmd log with the cmd typed and the players name atm all it does is the cmd how do i fix it? heres code

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  CmdLog(cmdtext);
Код:
public CmdLog(string[])
{
  new entry[256];
  format(entry, sizeof(entry), "%s\n",string);
  new File:hFile;
  hFile = fopen("cmd.log", io_append);
  fwrite(hFile, entry);
  fclose(hFile);
}
Reply
#2

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
new string[64];
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
format(string, sizeof(string), "Player %s used %s command.", playername, cmdtext);
CmdLog(string);
return 0;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)