[HELP]Use ( as a command? hmmm
#1

Hey guys, i was just wondering if this command would work

pawn Код:
if(!strcmp(cmdtext, "(", true, 1))//local ooc
    {
      if(IsPlayerConnected(playerid))
      {
        if(AccountInfo[playerid][Logged] == 0)
        {
          SendClientMessage(playerid, COLOR_GREY, "  You havent logged in yet !");
          return 1;
        }
            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: /b [local ooc chat]");
                return 1;
            }
            format(string, sizeof(string), "(( %s says: %s ))", sendername, result);
            ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
            printf("%s", string);
        }
        return 1;
    }
If i done something wrong please say thanks

-Mike.
Reply
#2

I didn't understand, u did "(" And the CORRECT USAGE is: /b ??

How ?
Reply
#3

no i havnt corrected that yet, ignore that bit, i want the command to be ( though
Reply
#4

And it isnt working with ( ?
Reply
#5

no say you type /login or something it will do the ( instead.
Reply
#6

He wants to replace the slash to ( for commands, so instead of /help it would be (help , right?
Reply
#7

I don't think it can be.
Reply
#8

Hmmm. Dude i've done it, its just even if u type something with an ( in it or something with 2 letters (, true, 2); then it goes onto that chat
Reply
#9

OnPlayerText
Reply
#10

You can't do that with OnPlayerCommandText because that callback will be called only if you input / before other text.
Use OnPlayerText callback like //exora said.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)