[Pedido] Chat Noob
#1

Alguem Pode me arruma um Chat /noob Para duvidas ?
Reply
#2

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;

Reply
#3

Nao deu no meu Da comando invalido
Reply
#4

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

CMD:NOOB tinha que ser
Reply
#6

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
Reply
#7

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?
Reply
#8

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;
}
Reply
#9

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;

Reply
#10

Sim, troquei sem querer os sinais
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)