Command
#1

Hello, I want a command to write something in the game and I'm getting a file from a server that I wrote rescue server.'

ex (/text [description] and save file.txt in folder.)

Thank you
Reply
#2

Create .txt file in scriptfiles folder and make him call something.txt

make command

Код:
CMD:text(playerid, params[])
{
new yourtext[128];
if(sscanf(params,"s[128]",yourtext)) return SCM(playerid,-1, "Use: /text [description]");
new File:lFile = fopen("something.txt", io_append),
LogString[128];
format(LogString, sizeof(LogString),"%s \r\n", yourtext);
fwrite(lFile, LogString);
fclose(lFile);
return 1;
}
i think it will work
Reply
#3

pawn Код:
// ..
new File:lFile = fopen("something.txt", io_append),
// ..
if(lFile)
{
    write(lFile, LogString);
    fclose(lFile);
}
// ..
You must check if the file was opened successfully to write to/close it because you're going to have problems with crashes.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)