if(strcmp(cmd, "/m", true) == 0 || strcmp(cmd, "/megaphone", true) == 0) { tmp = strtok(cmdtext, idx); GetPlayerName(playerid, sendername, sizeof(sendername)); PlayerInfo[playerid][pGDE] = dini_Int(udb_encode(sendername), "levelgde"); if (!strlen(tmp) && PlayerInfo[playerid][pGDE] >= 1) { SendClientMessage(playerid, COLOR_DBLUE, "Uso correto: /m [mensagem]"); return 1; } if(logged[playerid] == 1) { if(PlayerInfo[playerid][pGDE] >= 1 || PlayerInfo[playerid][pBOPE] >= 1 || PlayerInfo[playerid][pPMLV] >= 1 || PlayerInfo[playerid][pPMSF] >= 1 || PlayerInfo[playerid][pChoque] >= 1 || PlayerInfo[playerid][pRodoviaria] >= 1) { for(new i=0; i <= MAX_PLAYERS; i++) if(GetDistanceBetweenPlayers(playerid, i) <= 50) { format(string, sizeof(string), "Polнcial %s: %s", sendername, tmp); SendClientMessage(i,COLOR_YELLOW,string); new PlayerName[30]; GetPlayerName(playerid, PlayerName, 30); printf("[Command] %s usou /m com a menssagem: %s", PlayerName, tmp); } } else { SendClientMessage(playerid, COLOR_RED, "Vocк nгo й um oficial!"); } } else { SendClientMessage(playerid, COLOR_RED, "Vocк tem que estar logado para usar este comando!"); } return 1; }
if(strcmp(cmd, "/m", true) == 0 || strcmp(cmd, "/megaphone", true) == 0)
{
new string[500];
tmp = strtok(cmdtext, idx);
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[playerid][pGDE] = dini_Int(udb_encode(sendername), "levelgde");
if (!strlen(tmp) && PlayerInfo[playerid][pGDE] >= 1)
{
SendClientMessage(playerid, COLOR_DBLUE, "Uso correto: /m [mensagem]");
return 1;
}
if(logged[playerid] == 1)
{
if(PlayerInfo[playerid][pGDE] >= 1 || PlayerInfo[playerid][pBOPE] >= 1 || PlayerInfo[playerid][pPMLV] >= 1 || PlayerInfo[playerid][pPMSF] >= 1 || PlayerInfo[playerid][pChoque] >= 1 || PlayerInfo[playerid][pRodoviaria] >= 1)
{
for(new i=0; i <= MAX_PLAYERS; i++)
if(GetDistanceBetweenPlayers(playerid, i) <= 50)
{
format(string, sizeof(string), "Polнcial %s: %s", sendername, tmp);
SendClientMessage(i,COLOR_YELLOW,string);
new PlayerName[30];
GetPlayerName(playerid, PlayerName, 30);
printf("[Command] %s usou /m com a menssagem: %s", PlayerName, tmp);
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "Vocк nгo й um oficial!");
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "Vocк tem que estar logado para usar este comando!");
}
return 1;
}
pawn Код:
|
if(strcmp(cmd, "/megafone", true) == 0 || strcmp(cmd, "/m", true) == 0)
{
if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, "Vocк nгo pode falar, pois foi calado");
return true;
}
if(IsPlayerConnected(playerid))
{
if(!IsACop(playerid))
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo й um policial!");
return true;
}
if(OnDuty[playerid] != 1)
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo Bateu o cartгo!");
return true;
}
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 [phone chat]");
return true;
}
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), "B.O.P.E %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(IsAGOV(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] == 16||PlayerInfo[playerid][pLider] == 16)
{
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] == 11||PlayerInfo[playerid][pLider] == 11)
{
format(string, sizeof(string), "Policia Federal %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 nenhuma equipe !");
return true;
}
}
return true;
}
PHP код:
|