Saving CreateObject() in a .txt file?
#2

pawn Код:
// example  SaveToFile("objs.txt","CreateObject(param, param, param, param...);");


stock SaveToFile(path[],text[]){
    new File:handle = fopen(path, io_append);
    if(handle)
    {
        new sOut[1024];
        format(sOut,1024,"%s\r\n",text);
        fwrite(handle,sOut);
        fclose(handle);
        return 1;
    }
    return 0;
}

you could use format first for the text[] argument and save that way.

this function will append to the file each time it is called,
if no file is created it will first create it.,
Reply


Messages In This Thread
Saving CreateObject() in a .txt file? - by Shetch - 25.06.2015, 03:24
Re: Saving CreateObject() in a .txt file? - by Jonny5 - 25.06.2015, 03:26
Re: Saving CreateObject() in a .txt file? - by Shetch - 25.06.2015, 03:29
Re: Saving CreateObject() in a .txt file? - by Jonny5 - 25.06.2015, 03:34
Re: Saving CreateObject() in a .txt file? - by Shetch - 25.06.2015, 03:37
Re: Saving CreateObject() in a .txt file? - by Jonny5 - 25.06.2015, 03:46

Forum Jump:


Users browsing this thread: 1 Guest(s)