30.11.2011, 18:22
pawn Код:
if(strcmp(cmd, "/megafone", true) == 0 || strcmp(cmd, "/m", 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_GRAD2, "USE: (/m)egafone [megaphone chat]");
return 1;
}
if(gTeam[playerid] == 2 || IsACop(playerid))
{
if(PlayerInfo[playerid][pMembro] == 1||PlayerInfo[playerid][pLider] == 1)
{
format(string, sizeof(string), "Policial Militar %s:o< %s", sendername, result);
ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
else if(PlayerInfo[playerid][pMembro] == 2||PlayerInfo[playerid][pLider] == 2)
{
format(string, sizeof(string), "BOPE %s:o< %s", sendername, result);
ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
else if(PlayerInfo[playerid][pMembro] == 3||PlayerInfo[playerid][pLider] == 3)
{
format(string, sizeof(string), "Exйrcito %s:o< %s", sendername, result);
ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
else if(gTeam[playerid] == 7 || IsAPre(playerid))
{
format(string, sizeof(string), "Governo %s:o< %s", sendername, result);
ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
else if(PlayerInfo[playerid][pMembro] == 17||PlayerInfo[playerid][pLider] == 17)
{
format(string, sizeof(string), "Policia Civil %s:o< %s", sendername, result);
ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
/*else if(PlayerInfo[playerid][pMembro] == 27||PlayerInfo[playerid][pLider] == 27)
{
format(string, sizeof(string), "CIA %s:o< %s", sendername, result);
ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}*/
else if(PlayerInfo[playerid][pMembro] == 28||PlayerInfo[playerid][pLider] == 28)
{
format(string, sizeof(string), "[GATE] %s:o< %s", sendername, result);
ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
printf("%s", string);
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, " Vocк nгo faz parte de nenhum equipe !");
return 1;
}
}
return 1;
}