command to save a file?
#1

Hey, I would like to know how to do a command 'eg : /saveaccount' and this command will save the .ini file of his name?

Exemple

John_Anumaz types : /saveaccount
It saves john_anumaz.ini's file
Reply
#2

easy
pawn Код:
if(strcmp(cmdtext, "/saveaccount", true) == 0)
    {
      new plname[MAX_PLAYER_NAME];
      GetPlayerName(playerid, plname, sizeof(plname));
      new File:sFile;
      new str[256]; format(str, sizeof(str), "%s.ini", plname);
      sFile = fopen(str, io_append);
      fwrite(sFile, "what to write into the file");
      fclose(sFile);
      return 1;
    }
this should be useful for you
Reply
#3

Thanks, I'll try it out tomorrow
Reply
#4

No, I didn't said to write something in a file, I said to save it
Reply
#5

Quote:
Originally Posted by anumaz
No, I didn't said to write something in a file, I said to save it
You'll save the file, but you should write something to .ini or you're going to leave it blank?
Reply
#6

Quote:
Originally Posted by Don Correlli
Quote:
Originally Posted by anumaz
No, I didn't said to write something in a file, I said to save it
You'll save the file, but you should write something to .ini or you're going to leave it blank?
There's already something writen in the file
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)