[AJUDA] Comando, й escroto mas.. -
Bryaan_Smith - 29.09.2011
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
Re: [AJUDA] Comando, й escroto mas.. -
CristoferBahr - 29.09.2011
tira o @ e poem /a '-'
if(text[0] == '/a' && (PlayerInfo[playerid][pTester] >= 1 || PlayerInfo[playerid][pAdmin] >= 1))
Re: [AJUDA] Comando, й escroto mas.. -
CyNiC - 29.09.2011
Se o primeiro caractere do texto for uma barra o OnPlayerText naх e chamado, apenas o OnPlayerCommandText й.
Re: [AJUDA] Comando, й escroto mas.. -
Bryaan_Smith - 29.09.2011
Nгo da ^^, isso jб tentei.
Re: [AJUDA] Comando, й escroto mas.. -
WLSF - 29.09.2011
Vai no OnPlayerCommandText e faz isso.
pawn Код:
if(!strcmp(cmdtext,"/a",true))
{
// Bota o resto do comando aqui
return 1;
}
Re: [AJUDA] Comando, й escroto mas.. -
Lipe_Stronda - 29.09.2011
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;
}