29.05.2010, 22:15
Hello,
I'm trying to figure out, when someone uses a radio, the other players around that players should be able to see what the player says in the radio, with ProxDetector.
I just got it to work, but the problem is, the player with the radio can see the ProxDetector message, he should only be able to see the SendRadioMessage.
Here is the Command:
Thanks, if you dont understand what I mean, just give me the word.
I'm trying to figure out, when someone uses a radio, the other players around that players should be able to see what the player says in the radio, with ProxDetector.
I just got it to work, but the problem is, the player with the radio can see the ProxDetector message, he should only be able to see the SendRadioMessage.
Here is the Command:
Код:
if(strcmp(cmd, "/radio", true) == 0 || strcmp(cmd, "/r", true) == 0) { if(IsPlayerConnected(playerid)) { GetPlayerName(playerid, sendername, sizeof(sendername)); new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[64]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; if(!strlen(result)) { SendClientMessage(playerid, COLOR_GREY, " USAGE: (/r)adio [text]"); return 1; } if(gTeam[playerid] == 10) { if(PlayerInfo[playerid][pRank] == 8) { format(string, sizeof(string), "** %s: %s **", sendername, result); } else if(PlayerInfo[playerid][pRank] == 7) { format(string, sizeof(string), "** %s: %s **", sendername, result); } else if(PlayerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "** %s: %s **", sendername, result); } else if(PlayerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "** %s: %s **", sendername, result); } else if(PlayerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "** %s: %s **", sendername, result); } else if(PlayerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "** %s: %s **", sendername, result); } else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "** %s: %s **", sendername, result); } else if(PlayerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "** %s: %s **", sendername, result); } else { format(string, sizeof(string), "** %s: %s **", sendername, result); } ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5); SendRadioMessage(10, COLOR_LIGHT_YELLOW, string); return 1; } else if(gTeam[playerid] == 11) { if(PlayerInfo[playerid][pRank] == 8) { format(string, sizeof(string), "** %s: %s **", sendername, result); } else if(PlayerInfo[playerid][pRank] == 7) { format(string, sizeof(string), "** %s: %s **", sendername, result); } else if(PlayerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "** %s: %s **", sendername, result); } else if(PlayerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "** %s: %s **", sendername, result); } else if(PlayerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "** %s: %s **", sendername, result); } else if(PlayerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "** %s: %s **", sendername, result); } else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "** %s: %s **", sendername, result); } else if(PlayerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "** %s: %s **", sendername, result); } else { format(string, sizeof(string), "** %s: %s **", sendername, result); } ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5); SendRadioMessage(11, COLOR_LIGHT_YELLOW, string); return 1; } else if(gTeam[playerid] == 12) { if(PlayerInfo[playerid][pRank] == 8) { format(string, sizeof(string), "** %s: %s **", sendername, result); } else if(PlayerInfo[playerid][pRank] == 7) { format(string, sizeof(string), "** %s: %s **", sendername, result); } else if(PlayerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "** %s: %s **", sendername, result); } else if(PlayerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "** %s: %s **", sendername, result); } else if(PlayerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "** %s: %s **", sendername, result); } else if(PlayerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "** %s: %s **", sendername, result); } else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "** %s: %s **", sendername, result); } else if(PlayerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "** %s: %s **", sendername, result); } else { format(string, sizeof(string), "** %s: %s **", sendername, result); } ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5); SendRadioMessage(12, COLOR_LIGHT_YELLOW, string); return 1; } else if(gTeam[playerid] == 13) { if(PlayerInfo[playerid][pRank] == 8) { format(string, sizeof(string), "** %s: %s **", sendername, result); } else if(PlayerInfo[playerid][pRank] == 7) { format(string, sizeof(string), "** %s: %s **", sendername, result); } else if(PlayerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "** %s: %s **", sendername, result); } else if(PlayerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "** %s: %s **", sendername, result); } else if(PlayerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "** %s: %s **", sendername, result); } else if(PlayerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "** %s: %s **", sendername, result); } else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "** %s: %s **", sendername, result); } else if(PlayerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "** %s: %s **", sendername, result); } else { format(string, sizeof(string), "** %s: %s **", sendername, result); } ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5); SendRadioMessage(13, COLOR_LIGHT_YELLOW, string); return 1; } else { SendClientMessage(playerid, COLOR_GREY, " You are not part of the Law Enforcement."); return 1; } } return 1; }