[Ajuda] Comando "@" "!", etc
#7

Isto deve resolver o seu problema .


Coloque :


pawn Код:
//Na public OnPlayerText:
if((text[0] == '@') && IsPlayerAdmin(playerid) && (strlen(text) > 0))
    {
        new nick[MAX_PLAYER_NAME];
        GetPlayerName(playerid, nick, MAX_PLAYER_NAME);
        strdel(text, 0, 1);
        format(text,128,"[Chat Admin] %s diz: %s", nick, text);
        for(new x = 0, y = GetMaxPlayers(); x != y; x++)
        {
            if(IsPlayerAdmin(x))
            {
                SendClientMessage(x, 0x33CCFFAA, text);
            }
        }
        return 0;
    }
Assim quando digitar no "T" algo como:

Quote:

@Oi Galera da RCON !

A mensagem aparecerб na tela, desta forma:

Quote:

[Chat Admin] SeuNomeAqui diz: Oi Galera da RCON!

.




Quote:
Originally Posted by Shadoww5
Посмотреть сообщение
1 - Por que sem o define daria erro ?

2 - Pra que strmid ?

3 - Cade a stock Player(playerid) .. ?
1:R - Por que o sнmbolo COLOR_KRED (que aparece no cуdigo) nгo existe, pois ele nгo jб vem definido como ocorre com o MAX_PLAYERS.


2:R - O Strmid, no caso, foi usado para capturar todos os caracteres de uma string e passar pra outra, em outras palavras, para fazer uma igualaзгo .


3:R - Boa pergunta .




Espero ter ajudado .
Reply


Messages In This Thread
[Ajuda] Comando "@" "!", etc - by [Red]Maninho - 08.07.2011, 16:32
Re: [Ajuda] Comando "@" "!", etc - by Josma_cmd - 08.07.2011, 16:53
Re: [Ajuda] Comando "@" "!", etc - by wallon - 08.07.2011, 16:54
Re: [Ajuda] Comando "@" "!", etc - by Shadoww5 - 08.07.2011, 17:08
Respuesta: [Ajuda] Comando "@" "!", etc - by [Red]Maninho - 08.07.2011, 17:13
Re: [Ajuda] Comando "@" "!", etc - by Josma_cmd - 08.07.2011, 17:15
Re: [Ajuda] Comando "@" "!", etc - by rjjj - 08.07.2011, 17:19
Respuesta: [Ajuda] Comando "@" "!", etc - by [Red]Maninho - 08.07.2011, 17:35

Forum Jump:


Users browsing this thread: 5 Guest(s)