SA-MP Forums Archive
[HELP]Use ( as a command? hmmm - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP]Use ( as a command? hmmm (/showthread.php?tid=102162)



[HELP]Use ( as a command? hmmm - [NYRP]Mike. - 13.10.2009

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.


Re: [HELP]Use ( as a command? hmmm - MartinDaniel - 13.10.2009

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

How ?


Re: [HELP]Use ( as a command? hmmm - [NYRP]Mike. - 13.10.2009

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


Re: [HELP]Use ( as a command? hmmm - MartinDaniel - 13.10.2009

And it isnt working with ( ?


Re: [HELP]Use ( as a command? hmmm - [NYRP]Mike. - 13.10.2009

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



Re: [HELP]Use ( as a command? hmmm - Born2die - 13.10.2009

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


Re: [HELP]Use ( as a command? hmmm - MartinDaniel - 13.10.2009

I don't think it can be.


Re: [HELP]Use ( as a command? hmmm - [NYRP]Mike. - 13.10.2009

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


Re: [HELP]Use ( as a command? hmmm - woot - 14.10.2009

OnPlayerText


Re: [HELP]Use ( as a command? hmmm - Correlli - 14.10.2009

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.