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; }
CMD:fr(playerid, params[]) {
return cmd_r(playerid, params);
}
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:/r(playerid,params[]) { if(iGroupID = PlayerInfo[playerid][pMember]==0,PlayerInfo[playerid][pFMember]!=0) { ////do only family chat } if(iGroupID = PlayerInfo[playerid][pMember]!=0,PlayerInfo[playerid][pFMember]==0) { ////do only faction chat } new text[128],identifier[3]; if(sscanf(params,"s[1]s[128]",identifier,text)) return //dosomething if(strcmp(identifier,"fam")==0) { ///dooo youur stuff for family chat } if(strcmp(identifier,"fac")==0) { ///dooo youur stuff for faction chat } }
/r fam [text] ///this is message to your family radio /r fac [text] ///this is message to your faction radio
if factions and families are different than eachother you have to use something like:
Код:
CMD:/r(playerid,params[]) { new text[128],identifier[3]; if(sscanf(params,"s[1]s[128]",identifier,text)) return //dosomething if(strcmp(identifier,"fam")==0) { ///dooo youur stuff for family chat } if(strcmp(identifier,"fac")==0) { ///dooo youur stuff for faction chat } } Код:
/r fam [text] ///this is message to your family radio /r fac [text] ///this is message to your faction radio |
CMD:/r(playerid,params[]) { if(iGroupID = PlayerInfo[playerid][pMember]==0,PlayerInfo[playerid][pFMember]!=0) { ////do only family chat } if(iGroupID = PlayerInfo[playerid][pMember]!=0,PlayerInfo[playerid][pFMember]==0) { ////do only faction chat } new text[128],identifier[3]; if(sscanf(params,"s[1]s[128]",identifier,text)) return //dosomething if(strcmp(identifier,"fam")==0) { ///dooo youur stuff for family chat } if(strcmp(identifier,"fac")==0) { ///dooo youur stuff for faction chat } }
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 [radio 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); switch(FamilyInfo[fam][FamilyColor]) { case 0: // Black { SendNewFamilyMessage(PlayerInfo[playerid][pFMember], COLOR_BLACK, string); } case 1: // White { SendNewFamilyMessage(PlayerInfo[playerid][pFMember], COLOR_WHITE, string); } case 2: // Red { SendNewFamilyMessage(PlayerInfo[playerid][pFMember], COLOR_TWRED, string); } case 3: // Blue { SendNewFamilyMessage(PlayerInfo[playerid][pFMember], COLOR_TWBLUE, string); } case 4: // Yellow { SendNewFamilyMessage(PlayerInfo[playerid][pFMember], COLOR_TWYELLOW, string); } case 5: // Purple { SendNewFamilyMessage(PlayerInfo[playerid][pFMember], COLOR_TWPURPLE, string); } case 6: // Pink { SendNewFamilyMessage(PlayerInfo[playerid][pFMember], COLOR_TWPINK, string); } case 7: // Brown { SendNewFamilyMessage(PlayerInfo[playerid][pFMember], COLOR_TWBROWN, string); } case 8: // Gray { SendNewFamilyMessage(PlayerInfo[playerid][pFMember], COLOR_TWGRAY, string); } case 9: // Olive { SendNewFamilyMessage(PlayerInfo[playerid][pFMember], COLOR_TWOLIVE, string); } case 10: // Tan { SendNewFamilyMessage(PlayerInfo[playerid][pFMember], COLOR_TWTAN, string); } case 11: // Aqua { SendNewFamilyMessage(PlayerInfo[playerid][pFMember], COLOR_TWAQUA, string); } case 12: // Orange { SendNewFamilyMessage(PlayerInfo[playerid][pFMember], COLOR_TWORANGE, string); } case 13: // Azure { SendNewFamilyMessage(PlayerInfo[playerid][pFMember], COLOR_TWAZURE, string); } case 14: // Green { SendNewFamilyMessage(PlayerInfo[playerid][pFMember], COLOR_TWGREEN, string); } } } else { format(string, sizeof(string), "** (%i) %s %s: %s **", PlayerInfo[playerid][pRank], FamilyRankInfo[fam][PlayerInfo[playerid][pRank]], GetPlayerNameEx(playerid), params); switch(FamilyInfo[fam][FamilyColor]) { case 0: // Black { SendNewFamilyMessage(PlayerInfo[playerid][pFMember], COLOR_BLACK, string); } case 1: // White { SendNewFamilyMessage(PlayerInfo[playerid][pFMember], COLOR_WHITE, string); } case 2: // Red { SendNewFamilyMessage(PlayerInfo[playerid][pFMember], COLOR_TWRED, string); } case 3: // Blue { SendNewFamilyMessage(PlayerInfo[playerid][pFMember], COLOR_TWBLUE, string); } case 4: // Yellow { SendNewFamilyMessage(PlayerInfo[playerid][pFMember], COLOR_TWYELLOW, string); } case 5: // Purple { SendNewFamilyMessage(PlayerInfo[playerid][pFMember], COLOR_TWPURPLE, string); } case 6: // Pink { SendNewFamilyMessage(PlayerInfo[playerid][pFMember], COLOR_TWPINK, string); } case 7: // Brown { SendNewFamilyMessage(PlayerInfo[playerid][pFMember], COLOR_TWBROWN, string); } case 8: // Gray { SendNewFamilyMessage(PlayerInfo[playerid][pFMember], COLOR_TWGRAY, string); } case 9: // Olive { SendNewFamilyMessage(PlayerInfo[playerid][pFMember], COLOR_TWOLIVE, string); } case 10: // Tan { SendNewFamilyMessage(PlayerInfo[playerid][pFMember], COLOR_TWTAN, string); } case 11: // Aqua { SendNewFamilyMessage(PlayerInfo[playerid][pFMember], COLOR_TWAQUA, string); } case 12: // Orange { SendNewFamilyMessage(PlayerInfo[playerid][pFMember], COLOR_TWORANGE, string); } case 13: // Azure { SendNewFamilyMessage(PlayerInfo[playerid][pFMember], COLOR_TWAZURE, string); } case 14: // Green { SendNewFamilyMessage(PlayerInfo[playerid][pFMember], COLOR_TWGREEN, string); } } } } else { SendClientMessageEx(playerid, COLOR_GRAD2, "You are not in a family."); } return 1; }
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; }
I never understood why some scripts make families and factions different while it'd be so much easier to use "factions" as a base for both illegal and legal factions. I feel like it'd be much easier for you to simply remove families and stick only to factions.
|
I've seen quite a few servers where they have faction instead of families and factions and they do just fine tho'
|
/setchannel [radiochannel] /r [text goes to radio channel he selected]
I've seen quite a few servers where they have faction instead of families and factions and they do just fine tho'
|