[Pedido] Colocar comando no chat admin!
#1

Olб! entгo eu tenho um chat exclusivo para administraзгo. Porem para falar no chat й preciso fazer: "# [Mensagem]" e eu gostaria que fosse algo como "/aa [Mensagem]" Alguйm poderia me ajudar a criar esse cmd? Obrigado.

PHP код:
public OnPlayerText(playerid, text[])
{
        if(
text[0] == '#' && PlayerInfo[playerid][Level] >= 1) {
        new 
string[128]; GetPlayerName(playerid,string,sizeof(string));
        
format(string,sizeof(string),"| Admin Chat | %s[%i]:%s",string,playerid,text[1]); MessageToAdmins(COLOR_NOVO,string);
        return 
0;
    }
    
    if(
ServerInfo[MustLogin] == 1 && PlayerInfo[playerid][Registered] == 1 && PlayerInfo[playerid][LoggedIn] == 0)
    {
    
SendClientMessage(playerid,red,"| ERRO | Vocк nгo estб Logado!");
    return 
0;
    }
    if(
ServerInfo[DisableChat] == 1) {
        
SendClientMessage(playerid,red,"| ERRO | O chat esta Desativado!");
         return 
0;
    } 
Lembrando meu sistema de comando й "DCMD" Grato!
Reply
#2

PHP код:
dcmd:aa(playerid, params[])
{
    new 
texto[120], string[120], nome[MAX_PLAYER_NAME];
    if(
sscanf(params, "u", texto)) return SendClientMessage(playerid, -1, "[CORRETOR] - Use /aa [mensagem]");
    
GetPlayerName(playerid, nome, 24);
    
format(string, sizeof(string), "[CHAT ADMIN] %s - %s", nome ,texto);
    
MessageToAdmins(-1, string);
    return 
1;
} 
Reply
#3

PHP код:
CMD:aa(playerid, params[])
{      
       
PlayerInfo[playerid][Level] >= 1) { 
        new 
string[128]; GetPlayerName(playerid,string,sizeof(string)); 
        
format(string,sizeof(string),"| Admin Chat | %s[%i]:%s",string,playerid,text[1]); MessageToAdmins(COLOR_NOVO,string); 
        return 
0; 
    } 
     
    if(
ServerInfo[MustLogin] == 1 && PlayerInfo[playerid][Registered] == 1 && PlayerInfo[playerid][LoggedIn] == 0) 
    { 
    
SendClientMessage(playerid,red,"| ERRO | Vocк nгo estб Logado!"); 
    return 
0; 
    } 
    if(
ServerInfo[DisableChat] == 1) { 
        
SendClientMessage(playerid,red,"| ERRO | O chat esta Desativado!"); 
         return 
0; 
    } 
Tente assim.
Reply
#4

Obrigado a tds! Resolvido.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)