[Ajuda] Msg all COP on
#1

Eu queria uma ajuda pra mandar msg pra todos os COPs on quando o lider ativa-se o bope, eu fiz o bope,mas qnd ativa ґso aparece msg pro lider no caso o player q deu o comando, queria q manda-se pra todos
Essa parte do ultimo codigo \/
pawn Код:
if(IsACop(playerid))
{
    new pName[MAX_PLAYER_NAME], stest[64];
    GetPlayerName(playerid, pName, sizeof(pName));
    format(stest, sizeof(stest), "O %s ativou o BOPE", pName);
    SendClientMessage(playerid, TEAM_BLUE_COLOR, stest);
    PlayAudioStreamForPlayer(playerid,"https://www.dropbox.com/s/b4au2pz3gxv2uhm/Tihuana%20-%20Tropa%20de%20Elite.mp3?dl=1");
}
pawn Код:
if (strcmp("/bope", cmdtext, true, 10) == 0){
    if(PlayerInfo[playerid][pLider] == 1 || PlayerInfo[playerid][pLider] == 16){
    if(bope == 0){
    bope = 1;
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Vocк ativou o BOPE!");

if(IsACop(playerid))
{
    new pName[MAX_PLAYER_NAME], stest[64];
    GetPlayerName(playerid, pName, sizeof(pName));
    format(stest, sizeof(stest), "O %s ativou o BOPE", pName);
    SendClientMessage(playerid, TEAM_BLUE_COLOR, stest);
    PlayAudioStreamForPlayer(playerid,"https://www.dropbox.com/s/b4au2pz3gxv2uhm/Tihuana%20-%20Tropa%20de%20Elite.mp3?dl=1");
}

    return 1;
    }
    else if(bope == 1){
    bope = 0;
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Vocк desativou o BOPE!");

if(IsACop(playerid))
{
    new pName[MAX_PLAYER_NAME], stest[64];
    GetPlayerName(playerid, pName, sizeof(pName));
    format(stest, sizeof(stest), "O %s desativou o BOPE", pName);
    SendClientMessage(playerid, TEAM_BLUE_COLOR, stest);
}

    return 1;
    }
    else{
    SendClientMessage(playerid, COLOR_RED, "Esse comando sу pode ser usado por lнderes da PM/PC!");
    }
}
}
Reply
#2

pawn Код:
if (strcmp("/bope", cmdtext, true, 10) == 0)
{
    new pName[MAX_PLAYER_NAME], stest[64];
    GetPlayerName(playerid, pName, sizeof(pName));
    if(PlayerInfo[playerid][pLider] == 1 || PlayerInfo[playerid][pLider] == 16)
    {
        if(bope == 0 && IsACop(playerid))
        {
            bope = 1;
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "Vocк ativou o BOPE!");
            format(stest, sizeof(stest), "O %s ativou o BOPE", pName);
            SendRadioMessage(1,TEAM_BLUE_COLOR,stest);
            PlayAudioStreamForPlayer(playerid,"https://www.dropbox.com/s/b4au2pz3gxv2uhm/Tihuana%20-%20Tropa%20de%20Elite.mp3?dl=1");
        }
        else if(bope == 1 && IsACop(playerid))
        {
            bope = 0;
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "Vocк desativou o BOPE!");
            new pName[MAX_PLAYER_NAME], stest[64];
            GetPlayerName(playerid, pName, sizeof(pName));
            format(stest, sizeof(stest), "O %s desativou o BOPE", pName);
            SendRadioMessage(1,TEAM_BLUE_COLOR,stest);
        }
        return 1;
    }
    else
    {
        SendClientMessage(playerid, COLOR_RED, "Esse comando sу pode ser usado por lнderes da PM/PC!");
    }
    return 1;
}
Reply
#3

A msg sу foi pro lider os outros membros nгo viram a msg "o bope foi ativado" sу o cara q deu o comando, os ourtos cops n!
Reply
#4

pawn Код:
if (strcmp("/bope", cmdtext, true, 10) == 0)
{
    new pName[MAX_PLAYER_NAME], stest[64];
    GetPlayerName(playerid, pName, sizeof(pName));
    if(PlayerInfo[playerid][pLider] == 1 || PlayerInfo[playerid][pLider] == 16 || PlayerInfo[playerid][pMembro] == 1 || PlayerInfo[playerid][pMembro] == 16)
    {
        if(bope == 0 && IsACop(playerid))
        {
            bope = 1;
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "Vocк ativou o BOPE!");
            format(stest, sizeof(stest), "O %s ativou o BOPE", pName);
            SendRadioMessage(1,TEAM_BLUE_COLOR,stest);
            PlayAudioStreamForPlayer(playerid,"https://www.dropbox.com/s/b4au2pz3gxv2uhm/Tihuana%20-%20Tropa%20de%20Elite.mp3?dl=1");
        }
        else if(bope == 1 && IsACop(playerid))
        {
            bope = 0;
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "Vocк desativou o BOPE!");
            new pName[MAX_PLAYER_NAME], stest[64];
            GetPlayerName(playerid, pName, sizeof(pName));
            format(stest, sizeof(stest), "O %s desativou o BOPE", pName);
            SendRadioMessage(1,TEAM_BLUE_COLOR,stest);
        }
        return 1;
    }
    else
    {
        SendClientMessage(playerid, COLOR_RED, "Esse comando sу pode ser usado por lнderes da PM/PC!");
    }
    return 1;
}
Reply
#5

SendRadioMessage n tem isso, claro que deu erro, n tenho essa funзгo no meu sv =s
Como й que faz ela?
Reply
#6

@edit: Clique aqui!.
Reply
#7

Mas ai isso n ia funcionar em todos os outros, tipo gz, assalto, sу ta mandando msg pra qm usa o comando, queria tipo
ao usar /mandar
pega todos os jogadores da org tal onlines e manda msg "mandado pra eles" pra eu fazer sу de base pra todos os outros saca?
Reply
#8

@edit
Quote:
Originally Posted by pedrotvr
Посмотреть сообщение
Mas ai isso n ia funcionar em todos os outros, tipo gz, assalto, sу ta mandando msg pra qm usa o comando, queria tipo
ao usar /mandar
pega todos os jogadores da org tal onlines e manda msg "mandado pra eles" pra eu fazer sу de base pra todos os outros saca?
Bom, estuda esse codigo, e apartir dele vc monta um do seu gosto, o que o meu cmd faz ?
R: Qualquer pessoa que usar /bope apenas vai ficar aparecendo para TODOS os policias que fulano ativou o bope
pawn Код:
if(strcmp(cmd, "/bope", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
        GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
        SendClientMessage(playerid, COLOR_GREY, "Vocк Ativou o bope!");
        format(string, sizeof(string), "%s ativou o bope.", giveplayer);
        SendFamilyMessage(1, TEAM_AZTECAS_COLOR, string); // Se for o caso mude o 1 para o ID de uma das orgs policiais
        SendFamilyMessage(2, TEAM_AZTECAS_COLOR, string); // Se for o caso mude o 2 para o ID de uma das orgs policiais
        SendFamilyMessage(3, TEAM_AZTECAS_COLOR, string); // Se for o caso mude o 3 para o ID de uma das orgs policiais
        SendFamilyMessage(11, TEAM_AZTECAS_COLOR, string); // Se for o caso mude o 11 para o ID de uma das orgs policiais
        SendFamilyMessage(16, TEAM_AZTECAS_COLOR, string); // Se for o caso mude o 16 para o ID de uma das orgs policiais
        }
   }
Facil, Pratico e rapido
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)