SA-MP Forums Archive
[Ajuda] Bug na BroadCast - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Bug na BroadCast (/showthread.php?tid=356285)



Bug na BroadCast - LordShadow - 03.07.2012

Pessoal primeiro, eu vi esse novos perfixos [Ajuda] e [Pedido] que fizeram para o fуrum Portuguкs, Valeu ai !

@TOPIC, eu tenho um comando de chat de famнlia, por tanto ele funciona direitinho, mais quando o pessoal da familia fala pelo chat da familia, aparece para o server inteiro

BroadCast:

pawn Код:
public FWalkerBroadCast(COLOR,const string[],level)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
          if(strfind(Nome, "Walker", true) != -1)
            {
                SendClientMessage(i, COLOR, string);
                printf("%s", string);
            }
        }
    }
    return 1;
}
Comando:

pawn Код:
if(strcmp(cmd, "/fwalker", true) == 0 || strcmp(cmd, "/familiawalker", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
        GetPlayerName(playerid, Nome, 25);
            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: /fwalker ou /familiawalker [Chat Familia]");
                return 1;
            }
            if(strfind(Nome, "Walker", true) != -1)
            {
                format(string, sizeof(string), "Famнlia Walker %s: %s", PlayerName(playerid), result);
                FWalkerBroadCast(COLOR_AZULBB, string, 1);
            }
        }
        return 1;
    }



Re: Bug na BroadCast - Ricop522 - 03.07.2012

pawn Код:
public FWalkerBroadCast(COLOR,const string[],level)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            new _nome[24];
            GetPlayerName(i, _nome, 24);
            if(strfind(_nome, "Walker", true) != -1)
            {
                SendClientMessage(i, COLOR, string);
                printf("%s", string);
            }
        }
    }
    return 1;
}
Onde vc tб pegando o nome do cara? rs ( adicionei acima /\ ) tava faltando o GetPlayerName


Atй mais



Quote:
Originally Posted by LordShadow
Посмотреть сообщение
if(strfind(Nome, "Walker", true) != -1)

Tem que ter Walker no nome, para poder ver o BroadCast, mais o serer todo ta vendo
Como eu disse vocк estava esquecendo de coloca o nome do cara na funзгo ^^


Boa sorte


Re: Bug na BroadCast - LordShadow - 03.07.2012

if(strfind(Nome, "Walker", true) != -1)

Tem que ter Walker no nome, para poder ver o BroadCast, mais o serer todo ta vendo


VLW + REP