25.04.2013, 11:25
This is the command
the problem is that the message isnt sent out to the "senate" it isnt sent out at all! what am i doing wrong?
pawn Код:
if(strcmp(cmd, "/senate", true) == 0)
{
if(PlayerInfo[playerid][pSenate] == 0)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, "You are to Low Rank in 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: /senate [senate annouce]");
return 1;
}
if(PlayerInfo[playerid][pSenate] == 1) { format(string, sizeof(string), "Senator %s Say: %s.",sendername, result);}
else if(PlayerInfo[playerid][pSenate] == 2) { format(string, sizeof(string), "Archelon Senator %s Say: %s.",sendername, result);}
else if(PlayerInfo[playerid][pSenate] == 3) { format(string, sizeof(string), "Corleone Senator %s Say: %s.",sendername, result);}
else if(PlayerInfo[playerid][pSenate] == 4) { format(string, sizeof(string), "Advisor Senator %s Say: %s.",sendername, result);}
else if(PlayerInfo[playerid][pSenate] == 5) { format(string, sizeof(string), "GodFather's R.H %s Say: %s.",sendername, result);}
else if(PlayerInfo[playerid][pSenate] == 6) { format(string, sizeof(string), "GodFather %s Say: %s.",sendername, result);}
else if(PlayerInfo[playerid][pSenate] == 7) { format(string, sizeof(string), " [Unknown] [Criminal Senate] (radio): %s, over.", result);}
SendFamilyMessage(PlayerInfo[playerid][pSenate], 0x7BDDA5AA, string);
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;
}