Server crashes
#4

Here's how you would save text messages people have written into a file.
pawn Код:
public OnPlayerText(playerid, text[])
{
  new string[128], name[24], entry[256];
  format(string, sizeof(string), "%s(%i): %s", GetPlayerName(playerid, name, sizeof(name)), playerid, text);
  format(entry, sizeof(entry), "%s\r\n", string);
  new File:file;
  file = fopen("Text", io_append);
  if(file)
  {
   fwrite(file, string);
   fclose(file);
  }
  return 1;
}
EDIT:
Most if not all of those warnings are saying that the variables appear twice. That meaning, you most likely have a global variable of that variable, and then created it later inside a specific callback/function.
Reply


Messages In This Thread
Server crashes - by dawidek11 - 27.12.2009, 11:36
Re: Server crashes - by Grim_ - 27.12.2009, 11:39
Re: Server crashes - by dawidek11 - 27.12.2009, 12:14
Re: Server crashes - by Grim_ - 27.12.2009, 12:25
Re: Server crashes - by dawidek11 - 27.12.2009, 14:55

Forum Jump:


Users browsing this thread: 2 Guest(s)