Unknown Command on /dept
#1

pawn Код:
stock SendDeptMessage(color, string[])
{
    foreach(Player, i) {
                if(DAccess[i] != -1) { // Department Chat Access
            SendClientMessageEx(i, color, string);
        }
    }
}
I used printf to find out what causes the Unknown Command, SendDeptMessage, for some reason only ID 0 can see the messages yet, the player will still get a Unknown Command Error, other IDs/players won't see the message and get Unknown Command Error only.

SS:



First /dept was when no players are one, Second & Third are with 1 other player on
Reply
#2

SendClientMessageEx is maybe returning 0... You also might want that stock return 1, not sure if it helps anything tho.
Reply
#3

Quote:
Originally Posted by ddnbb
Посмотреть сообщение
SendClientMessageEx is maybe returning 0... You also might want that stock return 1, not sure if it helps anything tho.
it works now if their is more then 1 player in a faction, still always works if your ID 0
Reply
#4

Let's debug, shall we?
pawn Код:
stock SendDeptMessage(color, string[])
{
    foreach(Player, i) {
        printf("Iterator on player %d\n", i);
        if(DAccess[i] != -1) { // Department Chat Access
            printf("Player %d granted with DAccess %d\n", i, DAccess[i]);
            SendClientMessageEx(i, color, string);
        }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)