SA-MP Forums Archive
[Ajuda] Chat Com Adm - 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] Chat Com Adm (/showthread.php?tid=390184)



ZCMD + cHAT - smiiir - 05.11.2012

Resolvido
Tinha esquecido do zcmd


Re: Chat Com Adm - ViniBorn - 05.11.2012

Tire o loop ...


Re: Chat Com Adm - smiiir - 05.11.2012

pawn Код:
error 017: undefined symbol "i"
Tem que criar um new lб no topo do GM?


Re: Chat Com Adm - Ouro - 05.11.2012

Tente:

pawn Код:
if(strcmp(cmd, "/chatadm", true) == 0 || strcmp(cmd, "/ca", true) == 0)
{
    if(IsPlayerConnected(playerid) && PlayerInfo[playerid][pAdmin] >= 2 && PlayerInfo[playerid][pSocio] >= 4)
    {
        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: /chatadmin [mensagem]");
            return 1;
        }

        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(PlayerInfo[i][pAdmin] >= 2)
            {
                format(string, sizeof(string), "Admin %s: %s", sendername, result);
                SendGayMessage(0x9955DEEE, string);
                printf("Admin %s: %s", sendername, result);
            }

            if(PlayerInfo[i][pSocio] >= 4)
            {
                format(string, sizeof(string), "Sуcio %s: %s", sendername, result);
                SendGayMessage(0x9955DEEE, string);
                printf("Sуcio %s: %s", sendername, result);
            }
        }
    }
    return 1;
}



stock SendGayMessage(cor, string[]) //Adicione ao final de seu GameMode
{
    for(new i; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) && PlayerInfo[i][pAdmin] >= 2 && PlayerInfo[i][pSocio] >= 4)
        {
            SendClientMessage(i, cor, string);
        }
    }
    return 1;
}



Re: Chat Com Adm - smiiir - 05.11.2012

Pegou nгo mano /\

Sу eu Consigo ver, e admin nгo consegue escrever nem ver o chat, sу quando eu dou sуcio pra mim, aparece o Chat mais sу pra Sуcio level 4