SA-MP Forums Archive
[Pedido] Colocar comando no chat admin! - 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] Colocar comando no chat admin! (/showthread.php?tid=640419)



Colocar comando no chat admin! - CSSDean - 02.09.2017

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(playeridtext[])
{
        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] == && PlayerInfo[playerid][Registered] == && 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!


Re: Colocar comando no chat admin! - fxckshzt - 02.09.2017

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




Re: Colocar comando no chat admin! - Gguiz - 02.09.2017

PHP код:
CMD:aa(playeridparams[])
{      
       
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] == && PlayerInfo[playerid][Registered] == && 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.


Re: Colocar comando no chat admin! - CSSDean - 02.09.2017

Obrigado a tds! Resolvido.