14.09.2012, 18:04
Hello. ive made a ''senate'' radio wich i want all the criminal factions be able to see but the radio dosnt send out to any of the factions.. what have a done wrong?
pawn Код:
if(strcmp(cmd, "/Senate", true) == 0 || strcmp(cmd, "/sen", true) == 0)
{
if(PlayerInfo[playerid][pMara] == 0)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, "You are NOT part of the Senate!");
return 1;
}
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/sen)ate [senate radio annouce]");
return 1;
}
if(PlayerInfo[playerid][pMara] == 1)
{
if(PlayerInfo[playerid][pMara] == 1) { format(string, sizeof(string), "[Criminal Senate]:(radio): %s, over.", result);}
else if(PlayerInfo[playerid][pMara] == 2) { format(string, sizeof(string), "[Criminal Senate]:Senior Senator (radio): %s, over.", result);}
else if(PlayerInfo[playerid][pMara] == 3) { format(string, sizeof(string), "[Criminal Senate]:Lead Senator (radio): %s, over.", result);}
else if(PlayerInfo[playerid][pMara] == 4) { format(string, sizeof(string), " [Unknown] [Criminal Senate] (radio): %s, over.", result);}
ProxDetector(7.5, playerid, string,COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
SentMessage[playerid] = 1;
SendRadioMessage(5 && 6 && 8 && 13 && 14 && 15 && 16 && 17 && 18, TEAM_RADIO_COLOR, string);
SentMessage[playerid] = 1;
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,d);
format(string, sizeof(string), "[%d/%d/%d](%d:%d:%d) %s (radio): (%s)",d,m,y,h,mi,s, result);
RadioChatLog(string);
return 1;
}
return 1;
}