SA-MP Forums Archive
how to open file bat - 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)
+--- Thread: how to open file bat (/showthread.php?tid=534076)



how to open file bat - Xeinss - 27.08.2014

title
i need open file bat with cmd i try with this code :

http://pastebin.com/tESVdK22

ty for helpers


Re: how to open file bat - Eth - 27.08.2014

your code is wrong...
pawn Код:
if (strcmp(cmdtext,"/123123", true ) == 0 )
        {
        if(!fexist("file.bat"))
        {
         print("Your file does not exist");
        }
       else
       {
        new File:example1 = fopen("file.bat", io_readwrite);
        if(example1)
       
            fwrite(example1,"asdasd");//write the file
            fread(example1, "asdasd");
            fclose(example1);
        }
    }
    return 1;
        }



Re: how to open file bat - Xeinss - 27.08.2014

Quote:
Originally Posted by Eth
Посмотреть сообщение
your code is wrong...
pawn Код:
if (strcmp(cmdtext,"/123123", true ) == 0 )
        {
        if(!fexist("file.bat"))
        {
         print("Your file does not exist");
        }
       else
       {
        new File:example1 = fopen("file.bat", io_readwrite);
        if(example1)
       
            fwrite(example1,"asdasd");//write the file
            fread(example1, "asdasd");
            fclose(example1);
        }
    }
    return 1;
        }
again its not open my file
example :
write in txt file 123456
and i write the command in the game and the file is open in my computer.


Re: how to open file bat - Xeinss - 28.08.2014

UP..


Re: how to open file bat - Xeinss - 30.08.2014

Quote:
Originally Posted by ******
Посмотреть сообщение
If the file is open there are probably write locks in place.
So it is possible or not?