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



Comando - vdsvinicius - 11.07.2012

Olб, hoje resolvi aprender a faser um CMD e consegui(eu axo) mas to com uma duvida:
queria colocar mais de um CMD no mesmo comando(n intendeu nй)

pawn Код:
if (strcmp("noob", cmdtext, true)==0) //--- queria colocar mais nomes aki, Ex: troxa, server lixo, ETC...
    {
                Kick(playerid);
        SendClientMessageToAll(COR_ROXO, "Um Noob foi kikado por: Noй, Motivo: Palavreado excessivamente ofensivo" );
        return 1;
}
Se possivel me diga como coloco para aparecer o nome do cara que foi kikado, ex:
Fulano foi kikado por: Noй, Motivo: Palavreado excessivamente ofensivo.


Re: Comando - R3S1D3NT1 - 11.07.2012

Subistitua seu code por esse fisso aki no forum mermo
PHP код:
 if (strcmp("noob"cmdtexttrue)==0)
    {
        new 
string[256];
        new 
nome[MAX_PLAYER_NAME];
        
GetPlayerName(playeridnomeMAX_PLAYER_NAME);
        
format(stringsizeof(string), "[NOOB]: o Player %s Foi Kickado Do Servidor Por Motivo[Palavreado excessivamente ofensivo"nome);
        
Kick(playerid);
        return 
1;




Re: Comando - @Riichard - 11.07.2012

Quote:
Originally Posted by R3S1D3NT1
Посмотреть сообщение
Subistitua seu code por esse fisso aki no forum mermo
PHP код:
if (strcmp("noob"cmdtexttrue)==0)
{
        new 
string[256];
        new 
nome[MAX_PLAYER_NAME];
        
GetPlayerName(playeridnomeMAX_PLAYER_NAME);
        
format(stringsizeof(string), "[NOOB]: o Player %s Foi Kickado Do Servidor Por Motivo[Palavreado excessivamente ofensivo"nome);
        
Kick(playerid);
        return 
1;

Me diga oque vocк mudou, alem de por mensagem para todos? --'


@Topic
Tente :
pawn Код:
if (strcmp("noob", cmdtext, true) || strcmp("PALAVRA", cmdtext, true)  || strcmp("PALAVRA", cmdtext, true) ==0) //--- queria colocar mais nomes aki, Ex: troxa, server lixo, ETC...
{
        Kick(playerid);
        SendClientMessageToAll(COR_ROXO, "Um Noob foi kikado por: Noй, Motivo: Palavreado excessivamente ofensivo" );
        return 1;
}
Acho que funciona.


Re: Comando - R3S1D3NT1 - 11.07.2012

Quote:
Originally Posted by @Riichard
Посмотреть сообщение
Me diga oque vocк mudou, alem de por mensagem para todos? --'


@Topic
Tente :
pawn Код:
if (strcmp("noob", cmdtext, true) || strcmp("PALAVRA", cmdtext, true)  || strcmp("PALAVRA", cmdtext, true) ==0) //--- queria colocar mais nomes aki, Ex: troxa, server lixo, ETC...
{
        Kick(playerid);
        SendClientMessageToAll(COR_ROXO, "Um Noob foi kikado por: Noй, Motivo: Palavreado excessivamente ofensivo" );
        return 1;
}
Acho que funciona.
opa pera ae esquecir de uma coisa pera ae


Re: Comando - vdsvinicius - 11.07.2012

Cara ve o que tem de errado ai pa eu:
pawn Код:
public OnPlayerCommandText(playerid,cmdtext[])
{
     if (strcmp("noob", cmdtext, true)==0)
    {
        new string[256];
        new nome[MAX_PLAYER_NAME];
        GetPlayerName(playerid, nome, MAX_PLAYER_NAME);
        format(string, sizeof(string), "[NOOB]: o Player %s Foi Kickado Do Servidor Por Motivo[Palavreado excessivamente ofensivo", nome);
        Kick(playerid);
        return 1;
}

     if(strcmp(cmdtext,"/tutorial",true)==0)
    {
        SendClientMessage(playerid,COR_CINZA_AZUL,"Esse й um gamemode baseado em The Walking Dead.(Serie de zombies).");
        SendClientMessage(playerid,COLOR_YELLOW,"Zombis devem esfaquear humanos para infectб-los.");
        SendClientMessage(playerid,COLOR_YELLOW,"Humanos devem fugir e tentar matar os Zombis.");
        SendClientMessage(playerid,COLOR_RED,"[AVISO] Os Zombis tem 150 de HP, e Humanos 100!");
        SendClientMessage(playerid,COLOR_GREEN,"Com uma facada vocк vira zombi, entгo tome cuidado!!");
        return 1;
    }

    SendClientMessage(playerid,COLOR_RED,"[ERRO]: Esse comando nгo existe!");
    return 0;
}
Toda vez que add um cmd da erro ou os cmds nгo funcionam


Re: Comando - Saw_BR - 11.07.2012

pawn Код:
if(strcmp(cmd, "noob", true) == 0 || strcmp(cmd, "troxa", true) == 0 || strcmp(cmd, "lixo", true) == 0)
etc


Re: Comando - @Riichard - 11.07.2012

Quote:
Originally Posted by vdsvinicius
Посмотреть сообщение
Cara ve o que tem de errado ai pa eu:
pawn Код:
public OnPlayerCommandText(playerid,cmdtext[])
{
     if (strcmp("noob", cmdtext, true)==0)
    {
        new string[256];
        new nome[MAX_PLAYER_NAME];
        GetPlayerName(playerid, nome, MAX_PLAYER_NAME);
        format(string, sizeof(string), "[NOOB]: o Player %s Foi Kickado Do Servidor Por Motivo[Palavreado excessivamente ofensivo", nome);
        Kick(playerid);
        return 1;
}

     if(strcmp(cmdtext,"/tutorial",true)==0)
    {
        SendClientMessage(playerid,COR_CINZA_AZUL,"Esse й um gamemode baseado em The Walking Dead.(Serie de zombies).");
        SendClientMessage(playerid,COLOR_YELLOW,"Zombis devem esfaquear humanos para infectб-los.");
        SendClientMessage(playerid,COLOR_YELLOW,"Humanos devem fugir e tentar matar os Zombis.");
        SendClientMessage(playerid,COLOR_RED,"[AVISO] Os Zombis tem 150 de HP, e Humanos 100!");
        SendClientMessage(playerid,COLOR_GREEN,"Com uma facada vocк vira zombi, entгo tome cuidado!!");
        return 1;
    }

    SendClientMessage(playerid,COLOR_RED,"[ERRO]: Esse comando nгo existe!");
    return 0;
}
Toda vez que add um cmd da erro ou os cmds nгo funcionam
Pegue o codigo que eu passei..
E coloque em " OnPlayerText "

pawn Код:
if (strcmp("noob", cmdtext, true) || strcmp("PALAVRA", cmdtext, true)  || strcmp("PALAVRA", cmdtext, true) ==0) //--- queria colocar mais nomes aki, Ex: troxa, server lixo, ETC...
{
        Kick(playerid);
        SendClientMessageToAll(COR_ROXO, "Um Noob foi kikado por: Noй, Motivo: Palavreado excessivamente ofensivo" );
        return 0;
}



Re: Comando - vdsvinicius - 11.07.2012

Quote:
Originally Posted by @Riichard
Посмотреть сообщение
Pegue o codigo que eu passei..
E coloque em " OnPlayerText "

pawn Код:
if (strcmp("noob", cmdtext, true) || strcmp("PALAVRA", cmdtext, true)  || strcmp("PALAVRA", cmdtext, true) ==0) //--- queria colocar mais nomes aki, Ex: troxa, server lixo, ETC...
{
        Kick(playerid);
        SendClientMessageToAll(COR_ROXO, "Um Noob foi kikado por: Noй, Motivo: Palavreado excessivamente ofensivo" );
        return 0;
}
nгo tem OnPlayerText no meu gm, e agora?


Re: Comando - @Riichard - 11.07.2012

Quote:
Originally Posted by vdsvinicius
Посмотреть сообщение
nгo tem OnPlayerText no meu gm, e agora?
Crie :
pawn Код:
public OnPlayerText(playerid, text[])
{
    if(strfind(text, "Noob", true) || strfind(text, "PALAVRA", true) || strfind(text, "PALAVRA", true) ==0) //--- queria colocar mais nomes aki, Ex: troxa, server lixo, ETC...
    {
        Kick(playerid);
        SendClientMessageToAll(COR_ROXO, "Um Noob foi kikado por: Noй, Motivo: Palavreado excessivamente ofensivo" );
        return 0;
    }
    return 1;
}
Ve se funciona..


Re: Comando - .FuneraL. - 11.07.2012

Tгo Simples, nгo sei nem pra que uma briga -.-

pawn Код:
public OnPlayerText(playerid, text[])
{
    new NomeJogador[24];
    if(strfind(text, "Noob", true) || strfind(text, "PALAVRA", true) || strfind(text, "PALAVRA", true) ==0) //--- queria colocar mais nomes aki, Ex: troxa, server lixo, ETC...
    {
        GetPlayerName(playerid, NomeJogador, sizeof(NomeJogador));
        format(String, sizeof(String), "%s Foi Kickado por Palavreado Excessivamente Ofensivo", NomeJogador);
        SendClientMessageToAll(-1, String);
        Kick(playerid);
        return 0;
    }
    return 1;
}