SA-MP Forums Archive
[Pedido] Chat Noob - 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: [Pedido] Chat Noob (/showthread.php?tid=638464)



Chat Noob - Spanclear - 01.08.2017

Alguem Pode me arruma um Chat /noob Para duvidas ?


Re: Chat Noob - GuilhermeNunes - 01.08.2017

Esse chat й para novatos se comunicarem ou para mandar uma msg pro adm ? se for chat normal irei criar um aqui e ja edito

@Edit

PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
   
    new 
cmd[256];
    if(
strcmp(cmd,"/noob",true) == 0)
    {
        new 
texto[128], 
        
stryng[300];
        if(
sscanf(cmdtext,"s[7]s",cmd,texto))
        {
            
SendClientMessage(playerid,-1,"Use: /noob [texto]");
            return 
1;
        }
        
format(stryng,sizeof(stryng),"[Chat Noob] %s: %s"GetPlayerNameEx(playerid),texto);
        
SendClientMessageToAll(-1,stryng);
        return 
1;
    }
    return 
0;




Re: Chat Noob - Spanclear - 01.08.2017

Nao deu no meu Da comando invalido


Re: Chat Noob - GuilhermeNunes - 01.08.2017

qual й o seu processador de comando ? o comando ta certo acho que tu usa outro processador


Re: Chat Noob - Spanclear - 01.08.2017

CMD:NOOB tinha que ser


Re: Chat Noob - GuilhermeNunes - 01.08.2017

Quote:
Originally Posted by Spanclear
Посмотреть сообщение
CMD:NOOB tinha que ser
ZCMD ok eu tbm Uso malz eu fiz em strcmp pq a maioria dos novato usa irei fazer o chat agiatde ai

@Edit

PHP код:

CMD
:novato(playeridparams[])
{
    new 
string[128], Texto[200];
    if(
sscanf(params"s[128]"string)) return SendClientMessage(playerid, -1"Uso correto: /novato [Mensagem]");
    new 
nome[MAX_PLAYER_NAME];
    
GetPlayerName(playeridnomesizeof(nome));
    
format(Texto128"%s Diz: %s"nomestring);
    
SendClientMessage(iGetPlayerColor(playerid), Texto);
        
    return 
true;  // Deixa Return True para n duplicar a mensagem

Tenta Esss Mano Se der erro me avisa.. Via PM


Re: Chat Noob - zCyan - 01.08.2017

Quote:
Originally Posted by GuilhermeNunes
Посмотреть сообщение
Esse chat й para novatos se comunicarem ou para mandar uma msg pro adm ? se for chat normal irei criar um aqui e ja edito

@Edit

PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
   
    new 
cmd[256];
    if(
strcmp(cmd,"/noob",true) == 0)
    {
        new 
texto[128], 
        
stryng[300];
        if(
sscanf(cmdtext,"s[7]s",cmd,texto))
        {
            
SendClientMessage(playerid,-1,"Use: /noob [texto]");
            return 
1;
        }
        
format(stryng,sizeof(stryng),"[Chat Noob] %s: %s"GetPlayerNameEx(playerid),texto);
        
SendClientMessageToAll(-1,stryng);
        return 
1;
    }
    return 
0;

PHP код:
        if(sscanf(cmdtext,"s[7]s",cmd,texto))
        {
            
SendClientMessage(playerid,-1,"Use: /noob [texto]");
            return 
1;
        } 
Nossa, sscanf em strcmp?


Re: Chat Noob - LucasF - 01.08.2017

Vocк pode usar uma verificaзгo por level, Ex: Se o level for maior que 5 nгo vai poder usar o chat. Para alterar level sу mudar MAX_LEVEL_NOOB de 5 para o level que vocк quiser!

Код:
#define MAX_LEVEL_NOOB 5

CMD:novato(playerid, params[]) 
{ 
    new string[128], Texto[180];
    if(GetPlayerScore(playerid) > MAX_LEVEL_NOOB) return SendClientMessage(playerid, -1, "Vocк nгo й um NOVATO!")
    if(sscanf(params, "s[128]", string)) return SendClientMessage(playerid, -1, "Uso correto: /novato [Mensagem]"); 
    new nome[MAX_PLAYER_NAME]; 
    GetPlayerName(playerid, nome, sizeof(nome)); 
    format(Texto, 180, "Jogador: %s[NНVEL: %d] Diz: %s", nome, score, string); 
    SendClientMessage(i, GetPlayerColor(playerid), Texto); 
    return true;
}



Re: Chat Noob - IlanZ - 01.08.2017

PHP код:
CMD:novato(playeridparams[]) 

    new 
Texto[128];
    if(
GetPlayerScore(playerid) > 5) return SendClientMessage(playerid, -1"Vocк nгo й um NOVATO!")
    if(
isnull(params)) return SendClientMessage(playerid, -1"Uso correto: /novato [Mensagem]"); 
    new 
nome[MAX_PLAYER_NAME]; 
    
GetPlayerName(playeridnomesizeof(nome)); 
    for(new 
iMAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i) && GetPlayerScore(i) < 5)
        {
            
format(Texto128"Chat Noob. %s nivel[%d]: %s"nomescoreparams); 
            
SendClientMessage(i,-1Texto); 
        }
    }
    return 
true;




Re: Chat Noob - IlanZ - 01.08.2017

Sim, troquei sem querer os sinais