17.11.2017, 18:10
Hello, I need help with this, I have /r (radio chat) for factions only and have /fr for family I can make /fr & /r in one cmd /r?
/r codes
/fr codes
Thanks
/r codes
Код:
CMD:r(playerid, params[]) { new iGroupID = PlayerInfo[playerid][pMember], iRank = PlayerInfo[playerid][pRank]; if (0 <= iGroupID < MAX_GROUPS) { if (iRank >= arrGroupData[iGroupID][g_iRadioAccess]) { if(GetPVarInt(playerid, "togRadio") == 0) { if(!isnull(params)) { new string[128], employer[GROUP_MAX_NAME_LEN], rank[GROUP_MAX_RANK_LEN], division[GROUP_MAX_DIV_LEN]; format(string, sizeof(string), "(radio) %s", params); SetPlayerChatBubble(playerid, string, COLOR_WHITE, 15.0, 5000); GetPlayerGroupInfo(playerid, rank, division, employer); format(string, sizeof(string), "** [%s] %s (%s) %s: %s **", PlayerInfo[playerid][pBadge], rank, division, GetPlayerNameEx(playerid), params); foreach(new i: Player) { if(GetPVarInt(i, "togRadio") == 0) { if(PlayerInfo[i][pMember] == iGroupID && iRank >= arrGroupData[iGroupID][g_iRadioAccess]) { SendClientMessageEx(i, arrGroupData[iGroupID][g_hRadioColour] * 256 + 255, string); } if(GetPVarInt(i, "BigEar") == 1 || GetPVarInt(i, "BigEar") == 4 && GetPVarInt(i, "BigEarGroup") == iGroupID) { new szBigEar[128]; format(szBigEar, sizeof(szBigEar), "(BE) %s", string); SendClientMessageEx(i, arrGroupData[iGroupID][g_hRadioColour] * 256 + 255, szBigEar); } } } } else return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: (/r)adio [radio chat]"); } else return SendClientMessageEx(playerid, COLOR_GREY, "Your radio is currently turned off, type /togradio to turn it back on."); } else return SendClientMessageEx(playerid, COLOR_GREY, "You do not have access to this radio frequency."); } else return SendClientMessageEx(playerid, COLOR_GREY, "You are not in a group."); return 1; }
Код:
CMD:fr(playerid, params[]) { if(gFam[playerid] == 1) { SendClientMessageEx(playerid, COLOR_GRAD2, "You have your family chat disabled. /togfamily!"); return 1; } new fam = PlayerInfo[playerid][pFMember]; new string[128]; if(isnull(params)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: (/f)amily [family chat]"); if(IsAHitman(playerid)) { format(string, sizeof(string), "** (%d) %s %s: %s **", PlayerInfo[playerid][pRank], arrGroupRanks[PlayerInfo[playerid][pMember]][PlayerInfo[playerid][pRank]], GetPlayerNameEx(playerid), params); SendFamilyMessage(PlayerInfo[playerid][pMember], FamilyInfo[fam][FamilyColor], string); } else if(PlayerInfo[playerid][pFMember] < INVALID_FAMILY_ID) { if(0 <= PlayerInfo[playerid][pDivision] < 5) { new division[GROUP_MAX_DIV_LEN]; format(division, sizeof(division), "%s", FamilyDivisionInfo[PlayerInfo[playerid][pFMember]][PlayerInfo[playerid][pDivision]]); format(string, sizeof(string), "** (%i) %s (%s) %s: %s **", PlayerInfo[playerid][pRank], FamilyRankInfo[fam][PlayerInfo[playerid][pRank]], division, GetPlayerNameEx(playerid), params); SendNewFamilyMessage(fam, FamilyInfo[fam][FamilyColor], string); } else { format(string, sizeof(string), "** (%i) %s %s: %s **", PlayerInfo[playerid][pRank], FamilyRankInfo[fam][PlayerInfo[playerid][pRank]], GetPlayerNameEx(playerid), params); SendNewFamilyMessage(fam, FamilyInfo[fam][FamilyColor], string); } } else { SendClientMessageEx(playerid, COLOR_GRAD2, "You're not a part of a Family!"); } return 1; }