/Suggest Command
#4

Like this?
pawn Код:
if(strcmp(cmd, "/suggest", true) == 0)
    {
if(IsPlayerConnected(playerid))
{
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
            new length = strlen(cmdtext);
            while ((idx < length) && (cmdtext[idx] <= ' '))
            {
                idx++;
            }
            new offset = idx;
            new result[64];
            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
            {
                result[idx - offset] = cmdtext[idx];
                idx++;
            }
            result[idx - offset] = EOS;
            if(!strlen(result))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /(sugesst)ion [text]");
                return 1;
            }
new ip[16]; GetPlayerIp(playerid, ip, sizeof(ip));
            format(string, sizeof(string), "Your sugesstion: %s, your IP: %s and your name: %s.",(result),ip,sendername);
            SendClientMessage(playerid, COLOR_YELLOW, string);
            Suggestions(string);
}
return 1;
    }
pawn Код:
forward Suggestions(string[]);
pawn Код:
public Suggestions(string[])
{
    new entry[256];
    format(entry, sizeof(entry), "%s\r\n",string);
    new File:hFile;
    hFile = fopen("suggestions.log", io_append);
    fwrite(hFile, entry);
    fclose(hFile);
}
Reply


Messages In This Thread
/Suggest Command - by cozza123456 - 15.03.2010, 16:16
Re: /Suggest Command - by ruckfules99 - 15.03.2010, 16:18
Re: /Suggest Command - by cozza123456 - 15.03.2010, 16:22
Re: /Suggest Command - by Razvann - 15.03.2010, 16:28
Re: /Suggest Command - by cozza123456 - 15.03.2010, 16:40
Re: /Suggest Command - by MaykoX - 15.03.2010, 16:41
Re: /Suggest Command - by cozza123456 - 15.03.2010, 16:48
Re: /Suggest Command - by Razvann - 15.03.2010, 16:59
Re: /Suggest Command - by cozza123456 - 15.03.2010, 17:00
Re: /Suggest Command - by Razvann - 15.03.2010, 17:01

Forum Jump:


Users browsing this thread: 1 Guest(s)