Need an Easy Fs
#7

Finally got it working :

Code:
//======[Script/GM Beggining]=======//
.....

//======[CommandText]===========//

public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(suggest,7,cmdtext);
}

//======[DCMD Command]=========//

dcmd_suggest(playerid, params[])
{
  new string[128];
  if (sscanf(params, "s", string))
  {
    new File:handle = fopen("suggestions.txt", io_append);
    new Month, Day, Hour, Minute, Second, Year, pName[25], pIP[20];
    gettime(Hour, Minute, Second);
    getdate(Year, Month, Day);
    GetPlayerName(playerid, pName, sizeof(pName));
    GetPlayerIp(playerid, pIP, sizeof(pIP));
    format(string, 128, "|%d/%d|%d:%d|%s: %s |(%s)|\r\n", Day, Month, Hour, Minute, pName, string, pIP);
    fwrite(handle, string);
    fclose(handle);
    SendClientMessage(playerid, 0xC0C0C0FF, "Suggestion Send!");
  }
  else
  {
    SendClientMessage(playerid, 0xC0C0C0FF, "USAGE: /suggest [suggestions/whatever]");
  }
  return 1;
}

//======[Script/GM End]=============//
Also create a file called "suggestions.txt" in the Scripfiles folder, and here I tested it:

Code:
|8/5|20:0|[MFC]Sylar: Thank You for the Help! |(127.0.0.1)|
|8/5|20:1|[MFC]Sylar: blablablabla |(127.0.0.1)|
|8/5|20:1|[MFC]Sylar: Goodbye |(127.0.0.1)|
_______________________________

@ JaYmE:

The code you gave me didin't work, i changed somethings and solved the errors, thank you for the code , for example "GetTime(Day, Min, Sec)" has no sence at all, i changed it to "GetTime(Hour, Minute, Second);".

Goodbye!
Reply


Messages In This Thread
Need an Easy Fs - by MarcoNecroX - 08.05.2009, 19:18
Re: Need an Easy Fs - by ICECOLDKILLAK8 - 08.05.2009, 19:24
Re: Need an Easy Fs - by MarcoNecroX - 08.05.2009, 19:39
Re: Need an Easy Fs - by [nl]daplayer - 08.05.2009, 19:56
Re: Need an Easy Fs - by MarcoNecroX - 08.05.2009, 21:45
Re: Need an Easy Fs - by JaYmE - 08.05.2009, 22:00
Re: Need an Easy Fs - by MarcoNecroX - 08.05.2009, 23:11
Re: Need an Easy Fs - by Cardinaal - 10.04.2010, 18:32
Re: Need an Easy Fs - by ruckfules99 - 10.04.2010, 18:45
Re: Need an Easy Fs - by Cardinaal - 10.04.2010, 18:59

Forum Jump:


Users browsing this thread: 1 Guest(s)