/b interupts other commands starting with b
#1

Hello!
I am having a /b script, basically local ooc.

But after I created: /bomb, it appears:
(( LOCAL OOC: Christian_Hammer)) mb

my /b is:

pawn Код:
if(!strcmp(cmdtext, "/b", true, 2))
  {
    if(!cmdtext[2])
        SendClientMessage(playerid, 0xFF0000FF, "USAGE: /b [text]");
        {
    new string[128];
    GetPlayerName(playerid, string, sizeof(string));
    format(string, sizeof(string), "(( LOCAL OOC: %s)) %s", string, cmdtext[3]);
    ProxDetector(30, playerid, string,COLOR_GRAD1,COLOR_GRAD2,COLOR_GRAD3,COLOR_GRAD4,COLOR_GRAD5);
    }
 return 1;
}
Reply
#2

I would suggest using DCMD/ZCMD and params,
That way all you really need is params and not params[..] which is causing the problem i think
Reply
#3

ye sure, its obviously that the script stops all other commands with /b
If people have no clue what they do, they should use dcmd / zcmd like Joe already told us

Solution:

1. Put this command at the end of OnPlayerCommandText
2. use this fixed command

pawn Код:
if(strcmp(cmdtext[1], "b", true, 2) == 0 && (cmdtext[2] == EOS || cmdtext[2] == ' '))
    {
        if(cmdtext[2] != ' ' || cmdtext[3] == EOS)
            return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /b [text]");
        new string[166]; //Name (24) + Max typed text (124) + Added text (17) + EOS (1)
        GetPlayerName(playerid, string, sizeof(string));
        format(string, sizeof(string), "(( LOCAL OOC: %s)) %s", string, cmdtext[3]);
        return ProxDetector(30.0, playerid, string, COLOR_GRAD1, COLOR_GRAD2, COLOR_GRAD3, COLOR_GRAD4, COLOR_GRAD5);
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)