player suggestions command?
#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


Messages In This Thread
player suggestions command? - by lSCARl - 16.08.2010, 01:06
Re: player suggestions command? - by bigcomfycouch - 16.08.2010, 01:23

Forum Jump:


Users browsing this thread: 1 Guest(s)