How can i save
#1

Hi how can i make that: when serrevr send client message to aal i need to that message saves in file how can i create?
Reply
#2

pawn Код:
stock OOCLog(string[])
{
  new string[128];
  format(string,sizeof(string), "%s\r\n",string);
  new File:hFile;
  hFile = fopen("OOC.log", io_append);
  fwrite(hFile,string);
  fclose(hFile);
}
Under the SendClientMessageToAll part.
Reply
#3

dont save where problem?
Reply
#4

pawn Код:
stock OOCLog(string[])
{
  new buffer[128];
  format(buffer,sizeof(buffer), "%s\r\n",string);

  new File:hFile;
  hFile = fopen("OOC.log", io_append);

  fwrite(hFile,buffer);
  fclose(hFile);

  return 1;
}
and when you do a SendClientMessageToAll, you still need to call this function, a bit like this
pawn Код:
if (strcmp(cmdtext, "/all", true) == 0) // assume this is a command where SendClientMessageToAll is used
{
   new tmp[128];
   strmid(tmp, cmdtext, strfind(cmdtext, " "), strlen(tmp)); // get the message from the command string
   SendClientMessageToAll(COLOUR_MESSAGE, tmp); // sending the message
   OOCLog(tmp); // log it
}
Reply
#5

Thanx
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)