player suggestions command?
#1

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
Reply
#2

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


Forum Jump:


Users browsing this thread: 1 Guest(s)