SA-MP Forums Archive
player suggestions command? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: player suggestions command? (/showthread.php?tid=168371)



player suggestions command? - lSCARl - 16.08.2010

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


Re: player suggestions command? - bigcomfycouch - 16.08.2010

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;
}