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!