[AJUDA] Criar Gang Chat - 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] Criar Gang Chat (
/showthread.php?tid=325782)
[AJUDA] Criar Gang Chat -
blacktrindade - 14.03.2012
Bom pessoal nao to querendo usar FS de gang porque da muito problema , to criando um GM do 0 usando o new do Pawno!
Sou iniciante no Pawn, uma linguagem que eu to achando legal de mecher!
Primeiro, ja usei o search e apenas consegui topicos com os membros pedindo ajuda porque deu algum erro no chat da gang!
Entao queria saber se alguem pode me ajudar a criar um chat de gang/say
Obrigado pela atenзгo!
Re: [AJUDA] Criar Gang Chat -
Abravanel - 14.03.2012
Vou te dar um exemplo.
pawn Код:
new Gang[MAX_PLAYERS char];
forward SendMessageToPlayerGang(playerid, color, string[]);
public SendMessageToPlayerGang(playerid, color, string[])
{
if(Gang{playerid} == 1)
{
for(new i; i < MAX_PLAYERS; ++i)
{
if(IsPlayerConnected(i) && Gang{i} == 1)
{
SendClientMessage(i, color, string);
}
}
}
if(Gang{playerid} == 2)
{
for(new i; i < MAX_PLAYERS; ++i)
{
if(IsPlayerConnected(i) && Gang{i} == 2)
{
SendClientMessage(i, color, string);
}
}
}
}
Isso foi apenas um exemplo, vocк pode otimizar mais ele e acrescentar tambйm.
Agora um exemplo de como usar:
pawn Код:
CMD:virargang1(playerid)
{
Gang{playerid} = 1;
return true;
}
CMD:chat(playerid, params[])
{
new text[24], msg[128], Nome[24];
if(sscanf(params,"s",text)) return SendClientMessage(playerid,-1,"use /chat <texto>");
GetPlayerName(playerid,Nome,24);
format(msg,sizeof(msg),"* %s: %s",Nome,text);
SendMessageToPlayerGang(playerid, -1/*Cor*/, msg/*texto*/);
return true;
}
Re: [AJUDA] Criar Gang Chat -
ViniBorn - 14.03.2012
https://sampforum.blast.hk/showthread.php?tid=324849