/department
#1

I have a problem.
I have a command of /department chat, but it only works for Sheriff Department (gGroupType 1) and Army.
I want it to work with Medics too, when a Medic type /department [text] it doesn't give any message to a person who has written it, but to Army and SD it shows.
Also Medics doesn't see Army and SD /Department messages.

Any helpful?


pawn Code:
CMD:department(playerid, params[]) {

    if(playerVariables[playerid][pStatus] != 1 || playerVariables[playerid][pGroup] < 1)
        return SendClientMessage(playerid, COLOR_GREY, "Your group data is invalid.");

    if(groupVariables[playerVariables[playerid][pGroup]][gGroupType] == 1 && groupVariables[playerVariables[playerid][pGroup]][gGroupType] == 4) {
        return SendClientMessage(playerid, COLOR_GREY, "This group does not have an official radio frequency.");
 }

    if(playerVariables[playerid][pFreezeType] > 0) {
        return SendClientMessage(playerid, COLOR_GREY, "You can't use this command while cuffed, tazed, or frozen.");
 }

    if(isnull(params))
        return SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/d(epartment) [message]");

    GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);

    switch(playerVariables[playerid][pGroupRank]) {

        case 1: format(szMessage, sizeof(szMessage), "*** %s %s: %s, over.", groupVariables[playerVariables[playerid][pGroup]][gGroupRankName1], szPlayerName, params);
        case 2: format(szMessage, sizeof(szMessage), "*** %s %s: %s, over.", groupVariables[playerVariables[playerid][pGroup]][gGroupRankName2], szPlayerName, params);
        case 3: format(szMessage, sizeof(szMessage), "*** %s %s: %s, over.", groupVariables[playerVariables[playerid][pGroup]][gGroupRankName3], szPlayerName, params);
        case 4: format(szMessage, sizeof(szMessage), "*** %s %s: %s, over.", groupVariables[playerVariables[playerid][pGroup]][gGroupRankName4], szPlayerName, params);
        case 5: format(szMessage, sizeof(szMessage), "*** %s %s: %s, over.", groupVariables[playerVariables[playerid][pGroup]][gGroupRankName5], szPlayerName, params);
        case 6: format(szMessage, sizeof(szMessage), "*** %s %s: %s, over.", groupVariables[playerVariables[playerid][pGroup]][gGroupRankName6], szPlayerName, params);
        default: format(szMessage, sizeof(szMessage), "*** %s %s: %s, over.", groupVariables[playerVariables[playerid][pGroup]][gGroupRankName1], szPlayerName, params);
 }

    sendDepartmentMessage(COLOR_DCHAT, szMessage);
    format(szMessage, sizeof(szMessage), "(radio) ''%s''",params);
    SetPlayerChatBubble(playerid, szMessage, COLOR_CHATBUBBLE, 10.0, 10000);
    return 1;
}
Reply
#2

Show us:
pawn Code:
stock sendDepartmentMessage(COLOR_DCHAT, szMessage);
Reply
#3

There are not that kind of thing..
Reply
#4

Then it shouldn't even work, you see you're using sendDepartmentMessage(COLOR_DCHAT, szMessage);, but you don't have it defined
Reply
#5

pawn Code:
stock sendDepartmentMessage(colour, string[]) {
    foreach(Player, i) {
        if(playerVariables[i][pStatus] == 1 && (groupVariables[playerVariables[i][pGroup]][gGroupType] == 1 || groupVariables[playerVariables[i][pGroup]][gGroupType] == 2)) {
            SendClientMessage(i, colour, string);
        }
    }
    return 1;
}
Reply
#6

/Bump!
Reply
#7

How you define all groups you wanna use?
Reply
#8

I don't understand what you mean, but Sheriff's Group ID is 1 And medics is 4.

And I want /d to work with medics..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)