[Ajuda] Chat Gangue - 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: [Ajuda] Chat Gangue (
/showthread.php?tid=421971)
Chat Gangue -
vitorvlv - 11.03.2013
Entгo,fiz esse comando
pawn Код:
CMD:cg(playerid,params[])
{
new texto[120];
if(sscanf(params,"s",texto)) return SendClientMessage(playerid,vermelho,"/cg [texto]");
for(new i=0; i<MAX_PLAYERS; i++)
{
new nome[MAX_PLAYER_NAME];
GetPlayerName(playerid,nome,sizeof(nome));
if(gTeam[i] == Groove)
{
format(texto,sizeof(texto),"[Chat Groove]%s[id: %d]:%s",nome,playerid,texto);
SendClientMessage(i,verdeescuro,texto);
}
if(gTeam[i] == Ballas)
{
format(texto,sizeof(texto),"[Chat Ballas]%s[id: %d]:%s",nome,playerid,texto);
SendClientMessage(i,roxo,texto);
}
}
return true;
}
Sу que depois que eu digito ele,aparece a mensagem normal [Chat Groove]Vitor[id: 0]:blбblбblбblбblб
Sу que logo depois disso aparece SERVER:Unknown command.
queria que nгo mandasse o.o
Re: Chat Gangue -
@Riichard - 11.03.2013
Pode-se fazer assim:
pawn Код:
CMD:cg(playerid,params[])
{
new
nome[MAX_PLAYER_NAME],
String[128],
Texto[120]
;
if(sscanf(params, "s[120]", texto)) return SendClientMessage(playerid, vermelho, "/cg [texto]");
GetPlayerName(playerid, nome, sizeof(nome));
format(String, sizeof(String), "[ChatGang] %s(%d): %s", nome, playerid, texto);
ChatGang(playerid, verdeescuro, String);
return 1;
}
forward ChatGang(playerid, color, string[]);
public ChatGang(playerid, color, string[])
{
for (new r = 0; r != MAX_PLAYERS; r++)
{
if (IsPlayerConnected(r))
{
if(gTeam[r] == gTeam[playerid])
{
SendClientMessage(r, color, string);
}
}
}
return 1;
}
Re: Chat Gangue -
vitorvlv - 11.03.2013
Vlw =D
deu certo