16.08.2010, 01:23
using zcmd and sscanf
pawn Код:
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;
}