fwrite help
#4

pawn Код:
if( strcmp( cmdtext, "/leavenote", true ) == 0 )
{
   if( PlayerInfo[ playerid ][ pAdmin ] >= 1337 )
   {
      new
         string[ 128 ],
         File: open = fopen( "adminnotes.txt", io_append );
      ;

      format( string, sizeof( string ), "%s", cmdtext[ 11 ] );
      fwrite( open, string );
      fclose( open );
   }
   return 1;
}
This is just the basics of what you need, and doesn't need strtok!

Please note that this is just a sample. You will need to make sure the file exists before writing to it ( in this case ). I would also suggest adding a check to make sure the file is valid.
Reply


Messages In This Thread
fwrite help - by yarrum3 - 17.01.2011, 23:26
Re: fwrite help - by Jefff - 18.01.2011, 00:44
Re: fwrite help - by yarrum3 - 18.01.2011, 01:46
Re: fwrite help - by Grim_ - 18.01.2011, 02:21
Re: fwrite help - by yarrum3 - 18.01.2011, 05:31
Re: fwrite help - by Grim_ - 18.01.2011, 05:53

Forum Jump:


Users browsing this thread: 1 Guest(s)