[AJUDA] Comando, й escroto mas..
#1

Bom, sei que й engraзado, mas estou apanhando pra ageitar isso:

Код:
if(text[0] == '@' && (PlayerInfo[playerid][pTester] >= 1 || PlayerInfo[playerid][pAdmin] >= 1))
Eu quero trocar o comando de @ para /a

Reply
#2

tira o @ e poem /a '-'

if(text[0] == '/a' && (PlayerInfo[playerid][pTester] >= 1 || PlayerInfo[playerid][pAdmin] >= 1))
Reply
#3

Se o primeiro caractere do texto for uma barra o OnPlayerText naх e chamado, apenas o OnPlayerCommandText й.
Reply
#4

Nгo da ^^, isso jб tentei.
Reply
#5

Vai no OnPlayerCommandText e faz isso.
pawn Код:
if(!strcmp(cmdtext,"/a",true))
{
// Bota o resto do comando aqui
return 1;
}
Reply
#6

pawn Код:
if(strcmp(cmd, "/a", true) == 0 || strcmp(cmd, "/admin", true) == 0)
    {
        if(Administrador[playerid] == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "Vocк nгo й um {FF5500}Administrador"); //Bote a variavel do Administrador
        if(Administrador[playerid] >= 1) //Bote a variavel do Administrador
        {
            strmid(tmp, cmdtext, 2, strlen(cmdtext));
            if(strlen(tmp) == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "Use: /a [texto]");
            if(IsPlayerConnected(playerid))
            {
                GetPlayerName(playerid, Nome, sizeof(Nome));
                format(string, sizeof(string), "Chat: Level: %d Administrador: %s Diz: %s",Administrador[playerid], Nome,tmp);
                MensagemParaAdmin(0x1E90FFFF, string);
                return 1;
            }
        }
    }
pawn Код:
forward MensagemParaAdmin(COLOR,const string[]);
public MensagemParaAdmin(COLOR,const string[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(Administrador[i])// Troque pela variavel de adm do seu gm
            {
                SendClientMessage(i, COLOR, string);
            }
        }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)