30.10.2012, 21:26
There is no CreateFile function unfortunately. However, you can simply open the file in io_write mode and instantly close it, which will create the file.
As explained in the code, the file check is VERY basic. Expand on it in case of improper input.
pawn Код:
CMD:file(playerid, params[]) {
if(isnull(params) || !strfind(params, ".")) {
// invalid file format or no params entered
// this is a VERY shitty way of checking, so
// I highly suggest expanding this check to
// include already existed file names,
// spaces, invalid characters, etc.
} else {
new File: hFile = fopen(params, io_write);
fclose(hFile);
}
return 1;
}