[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(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!
Re: Colocar comando no chat admin! -
fxckshzt - 02.09.2017
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;
}
Re: Colocar comando no chat admin! -
Gguiz - 02.09.2017
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.
Re: Colocar comando no chat admin! -
CSSDean - 02.09.2017
Obrigado a tds! Resolvido.