17.03.2009, 13:29
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?
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);
}
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;
}
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
}