How can i save - 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: How can i save (
/showthread.php?tid=69323)
How can i save -
Scoots - 17.03.2009
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?
Re: How can i save -
MenaceX^ - 17.03.2009
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.
Re: How can i save -
Scoots - 17.03.2009
dont save where problem?
Re: How can i save -
[RP]Rav - 17.03.2009
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
}
Re: How can i save -
Scoots - 17.03.2009
Thanx