SERVER: Unknown Command but the Command works
#1

See
so i'm scripting an rp server, and it has basic commands etc.
/b works fine.. i have features of it to day like if someone is on admin duty or tester duty
but on problem. When someone is not on testerduty or admin duty, its OK. but when someone is, it says SERVER: Unknown Command. BUT it still shows the message, i mean it shows what you type
anyway here is the pawn code
pawn Код:
if(strcmp(cmd, "/b", true) == 0)//local ooc
    {
        if(IsPlayerConnected(playerid))
        {
            if(gPlayerLogged[playerid] == 0)
            {
                SendClientMessage(playerid, COLOR_GREY, "   You havent logged in yet !");
                return 1;
            }
            if(Mute[playerid] == 1)
            {
                SendClientMessage(playerid, TEAM_CYAN_COLOR, "   You can't speak, you have been silenced !");
                return 1;
            }
            GetPlayerName(playerid, sendername, sizeof(sendername));
            GiveNameSpace(sendername);
            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))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /b [local ooc chat]");
                return 1;
            }
            if(AdminDuty[playerid] == 1)
            {
                format(string, sizeof(string), "(( [Admin Duty] %s says: %s ))", sendername, result);
                ProxDetector(20.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
                return 0;
            }
            else if(TesterDuty[playerid] == 1)
            {
                format(string, sizeof(string), "(( [Tester Duty] %s says: %s ))", sendername, result);
                ProxDetector(20.0, playerid, string,0x990000FF,0x990000FF,0x990000FF,0x990000FF,0x990000FF);
                return 0;
            }
            if(PlayerInfo[playerid][pMaskUse] == 1)
            {
                format(string, sizeof(string), "(( Stranger_%d Says: %s ))", RandMask[playerid],result);
            }
            else
            {
                format(string, sizeof(string), "(( [%i] %s Says: %s ))", playerid, sendername, result);
            }
            if(PlayerInfo[playerid][pAdmin] == 0)
            {
                SendBMessage(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
            }
            else
            {
                ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
            }
        }
        return 1;
    }
Reply
#2

sorry but i need answer asap.. please answer server owners is waiting :P
Reply
#3

Try taking out all of the returns except the last one.
Reply
#4

Already tried. It makes you show all of them ie stranger, admin duty, normal, tester duty....
Reply
#5

Delete the return 0; from your AdminDuty & TesterDuty:

pawn Код:
if(AdminDuty[playerid] == 1)
            {
                format(string, sizeof(string), "(( [Admin Duty] %s says: %s ))", sendername, result);
                ProxDetector(20.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
            }
            else if(TesterDuty[playerid] == 1)
            {
                format(string, sizeof(string), "(( [Tester Duty] %s says: %s ))", sendername, result);
                ProxDetector(20.0, playerid, string,0x990000FF,0x990000FF,0x990000FF,0x990000FF,0x990000FF);
            }
Reply
#6

pawn Код:
if(strcmp(cmd, "/b", true) == 0)//local ooc
    {
        if(IsPlayerConnected(playerid))
        {
            if(gPlayerLogged[playerid] == 0)
            {
                SendClientMessage(playerid, COLOR_GREY, "   You havent logged in yet !");
                return 1;
            }
            if(Mute[playerid] == 1)
            {
                SendClientMessage(playerid, TEAM_CYAN_COLOR, "   You can't speak, you have been silenced !");
                return 1;
            }
            GetPlayerName(playerid, sendername, sizeof(sendername));
            GiveNameSpace(sendername);
            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))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /b [local ooc chat]");
                return 1;
            }
            if(AdminDuty[playerid] == 1)
            {
                format(string, sizeof(string), "(( [Admin Duty] %s says: %s ))", sendername, result);
                ProxDetector(20.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
                return 1;
            }
            else if(TesterDuty[playerid] == 1)
            {
                format(string, sizeof(string), "(( [Tester Duty] %s says: %s ))", sendername, result);
                ProxDetector(20.0, playerid, string,0x990000FF,0x990000FF,0x990000FF,0x990000FF,0x990000FF);
                return 1;
            }
            if(PlayerInfo[playerid][pMaskUse] == 1)
            {
                format(string, sizeof(string), "(( Stranger_%d Says: %s ))", RandMask[playerid],result);
            }
            else
            {
                format(string, sizeof(string), "(( [%i] %s Says: %s ))", playerid, sendername, result);
            }
            if(PlayerInfo[playerid][pAdmin] == 0)
            {
                SendBMessage(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
            }
            else
            {
                ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
            }
        }
        return 1;
    }
Reply
#7

@all http://i55.tinypic.com/1y79qq.png
Reply
#8

What's the Problem Now?
Reply
#9

Just see the image, when i go on tester duty and type /b it shows the testerduty phrase and the normal phrase TOO.
Reply
#10

Anyone.. please..
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)