File help
#5

Quote:
Originally Posted by lrZ^
change
pawn Код:
if(!strlen(cmdtext)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /suggest <your suggestion>");
to
pawn Код:
if(strlen(cmdtext) < 10) return SendClientMessage(playerid, COLOR_RED, "USAGE: /suggest <your suggestion>");
then he still use the wrong cell ... so

you used the wrong length
pawn Код:
if(!strcmp(cmdtext, "/suggest", true, 8)) //"/suggest" is 8 character long
        {
            if(cmdtext[8] != 32 || cmdtext[9] == EOS)
                return SendClientMessage(playerid, COLOR_RED, "USAGE: /suggest <your suggestion>");
            SendClientMessage(playerid, COLOR_WHITE, "SERVER: You have done a suggestion!");
            //I send the message before so the player dont notices if lag arise within the code
            new string[128];
                File:pos = fopen("suggestions.txt", io_append);
            GetPlayerName(playerid, string, MAX_NAME_LENGTH); //you can use one array for that too because the array gets
            format(string, sizeof string, "%s has suggested: %s\r\n", string, cmdtext[9]); //after the function "format" overwriten
            fwrite(pos, string), fclose(pos);
            return true;
        }
Reply


Messages In This Thread
File help - by GTA_Rules - 19.03.2009, 17:43
Re: File help - by MenaceX^ - 19.03.2009, 17:54
Re: File help - by GTA_Rules - 19.03.2009, 18:15
Re: File help - by LarzI - 19.03.2009, 18:24
Re: File help - by Nero_3D - 19.03.2009, 18:28
Re: File help - by LarzI - 19.03.2009, 18:31
Re: File help - by Nero_3D - 19.03.2009, 18:33
Re: File help - by GTA_Rules - 19.03.2009, 18:38
Re: File help - by LarzI - 19.03.2009, 18:43
Re: File help - by GTA_Rules - 19.03.2009, 18:46

Forum Jump:


Users browsing this thread: 2 Guest(s)