First off, "case" always starts on 0. Not 1.
Plus, I think you need to include the "SendToGroup(playerVariables[playerid][pGroup], COLOR_DCHAT, string);" behind the case line, and not at the bottom. Not fully sure about that one.
Try this;
pawn Код:
#define STG_12 SendToGroup(playerVariables[playerid][pGroup], COLOR_DCHAT, string);
CMD:group(playerid, params[]) {
if(playerVariables[playerid][pStatus] != 1 || playerVariables[playerid][pGroup] < 1) return 1;
if(groupVariables[playerVariables[playerid][pGroup]][gGroupType] == 1 || groupVariables[playerVariables[playerid][pGroup]][gGroupType] == 2)
{SendClientMessage(playerid, COLOR_GREY, "This group does not have an OOC chat."); return 1;}
new string[128];
if(isnull(params)) return SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/g(roup) [message]");
if(playerVariables[playerid][pFreezeType] > 0) return SendClientMessage(playerid, COLOR_GREY, "You can't use this command while cuffed, tazed, or frozen.");
GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);
switch(playerVariables[playerid][pGroupRank]) {
case 1: format(string, sizeof(string), "(Group Chat) %s %s: %s", groupVariables[playerVariables[playerid][pGroup]][gGroupRankName1], szPlayerName, params); STG_12
case 2: format(string, sizeof(string), "(Group Chat) %s %s: %s", groupVariables[playerVariables[playerid][pGroup]][gGroupRankName2], szPlayerName, params); STG_12
case 3: format(string, sizeof(string), "(Group Chat) %s %s: %s", groupVariables[playerVariables[playerid][pGroup]][gGroupRankName3], szPlayerName, params); STG_12
case 4: format(string, sizeof(string), "(Group Chat) %s %s: %s", groupVariables[playerVariables[playerid][pGroup]][gGroupRankName4], szPlayerName, params); STG_12
case 5: format(string, sizeof(string), "(Group Chat) %s %s: %s", groupVariables[playerVariables[playerid][pGroup]][gGroupRankName5], szPlayerName, params); STG_12
case 6: format(string, sizeof(string), "(Group Chat) %s %s: %s", groupVariables[playerVariables[playerid][pGroup]][gGroupRankName6], szPlayerName, params); STG_12
default: format(string, sizeof(string), "(Group Chat) %s %s: %s", groupVariables[playerVariables[playerid][pGroup]][gGroupRankName1], szPlayerName, params); STG_12
}
return 1;
}
PS: dont mind the STG_12, it's for debugging reasons. But you obviously need to include it.