[Ajuda] Chat Profissгo
#1

E aew galera, bom, eu queria saber como faзo um Chat Profissгo para meu Gamemode...

Eu tentei assim:
pawn Код:
CMD:cp(playerid, params[])
{
    new Texto[128], rNome[MAX_PLAYER_NAME], rString[128];
    if(sscanf(params, "s", Texto)) return SendClientMessage(playerid, ERRO, "(ERRO) {7FFFD4}USE: /cp [TEXTO]");
    for(new i; i < MAX_PLAYERS; ++i)
    {
        if(Info[i][zProfissao] == Info[playerid][zProfissao])
        {
            GetPlayerName(playerid, rNome, MAX_PLAYER_NAME);
            format(rString, sizeof(rString), "{7FFFD4}(Chat Profissгo) {AFEEEE}%s{7FFFD4}: {AFEEEE}%s", rNome, Texto);
            SendClientMessage(i, INFO, rString);
        }
    }
    return 1;
}
Reply
#2

pawn Код:
COMMAND:cp(playerid, params[])
{
    new Name[24], Msg[128], Message[128];

    SendAdminText(playerid, "/cp", params);

    GetPlayerName(playerid, Name, sizeof(Name));

    if (Info[playerid][LoggedIn] == true)
    {
        if (sscanf(params, "s[128]", Message)) SendClientMessage(playerid, 0xFF0000AA, "(ERRO) {7FFFD4}USE: /cp [TEXTO]");
        else
        {
            for (new i; i < MAX_PLAYERS; i++)
            {
                if (Info[i][LoggedIn] == true)
                {
        if(Info[i][zProfissao] == Info[playerid][zProfissao])
                    {
                        format(Msg, 128, "{7FFFD4}(Chat Profissгo) {AFEEEE}%s{7FFFD4}: {AFEEEE}%s", Name, Message);
                        SendClientMessage(i, 0xFFFFFFFF, Msg);
                    }
                }
            }
        }
    }
    else
        return 0;

    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)