Just a lil help
#1

Ok well before I pull my hair out... what is going wrong?

pawn Код:
if(strcmp(cmd, "/ac", true) == 0)
            {
                tmp = strtok(cmdtext, idx);
               
                new name[maxplayername];
               GetPlayerName(playerid, name, sizeof(name));
               
                new length = strlen(cmdtext);
                while ((idx < length) && (cmdtext[idx] <= ' '))
                {
                    idx++;
                }
                new offset = idx;
                new result[128];
                while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
                {
                    result[idx - offset] = cmdtext[idx];
                    idx++;
                }
                result[idx - offset] = EOS;
               
                if(!strlen(result))
                {
                  PlayerMessage(playerid, yellow1, "/ac [admin chat]");
                    return 1;
                }
               
                format(str, sizeof(str), "%s says: %s", name, result);
                if(Player[playerid][admin] > 0)
                {
                    PlayerMessage(playerid, ppurple3, str);
                }
              return 1;
            }
no, im not getting things compiling wrong, but the thing is the variable "result" is not returning anything... I feel like an idiot for getting to the point where I had to post this, but it saves me from ripping out more hair. Thanks for the help


EDIT: Alright, im an idiot... there is no need for the tmp = strtok(cmdtext, idx); at the beginning
Reply


Messages In This Thread
Just a lil help - by Kinetic - 03.03.2009, 10:02
Re: Just a lil help - by mamorunl - 03.03.2009, 10:03
Re: Just a lil help - by Kinetic - 03.03.2009, 10:06
Re: Just a lil help - by Dujma - 03.03.2009, 10:08
Re: Just a lil help - by Kinetic - 03.03.2009, 10:11
Re: Just a lil help - by Dujma - 03.03.2009, 10:14

Forum Jump:


Users browsing this thread: 1 Guest(s)