16.08.2010, 01:06
is it possible to make like a command where a player puts /suggest (server suggestion here) and it saves their suggestion to a log on my server? if so can someone help me make it
cmd(suggest, playerid, params[])
{
new suggestion[128];
if(sscanf(params, "s[128]", suggestion)) return SendClientMessage(playerid, 0xFF000000, "USAGE: /suggest [suggestion]");
new File: sug;
if(fexist("suggestions.txt")) sug = fopen("suggestions.txt", io_append);
else sug = fopen("suggestions.txt", io_write);
format(suggestion, 128, "%s\r\n", suggestion);
fwrite(sug, suggestion);
fclose(sug);
SendClientMessage(playerid, 0xFFFFFF00, "Your suggestion has been submitted.");
return 1;
}