Criando chat no modo torcidas/facзгo [Ex: ! Olб] -
ZePequeno - 14.05.2013
Entгo vamos lб
pawn Код:
public OnPlayerText(playerid, text[]) // Public aonde deve ser colocado
{
new String[180]; // String
new Nome[MAX_PLAYER_NAME]; // Definindo nome
GetPlayerName(playerid,Nome,sizeof(Nome)); // Getando o nome
if(text[0] == '!') // O comando
{ for(new i=0; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[i][pTorcidas] == 1) // na parte [Torcidas] vocк troca pra definiзгo da sua torcida/facзгo, uma dica pode pegar isso no OnPlayerSpawn
{
format(String,sizeof(String),"[Chat Torcida 01] %s (%d): %s", Nome,playerid, text[1]); // Menssagem quando vocк digita [! Olб galera]
if(PlayerInfo[i][pTorcidas] == 1) // Info da torcida/facзгo
SendClientMessage(i,COLOR_RED,String); // Cor da menssagem a o digitar o comando
}
if(PlayerInfo[i][pTorcidas] == 2) // Info da torcida/facзгo
{
format(String,sizeof(String),"[Chat Torcida 02] %s (%d): %s", Nome,playerid, text[1]); // Menssagem
if(PlayerInfo[i][pTorcidas] == 2) // Info da torcida/facзгo
SendClientMessage(i,COLOR_BLUE,String); // Cor da mensagem quando vocк digita o comando [! Eai galera blz?]
}
}
return 0; // returnando
}
return 1; // fechando a public
}
Pronto agora й sу editar a o seu gosto
Creditos: Zй Pequeno
Re: Criando chat no modo torcidas/facзгo [Ex: ! Olб] -
.FuneraL. - 14.05.2013
pawn Код:
public OnPlayerText(playerid, text[]) {
new String[250], Nome[24];
GetPlayerName(playerid, Nome, 24);
if(text[0] == '!') {
format(String, sizeof(String), "[Chat Torcida %d]: %s (%d): %s", PlayerInfo[playerid][pTorcidas], Nome, playerid, text[1]);
for(new i; i < MAX_PLAYERS; i++) {
if(PlayerInfo[playerid][pTorcidas] == PlayerInfo[i][pTorcidas]) {
SendClientMessage(i, -1, String);
}
}
}
return 1;
}
Simplesmente isso, nгo precisa complicar muito
Re: Criando chat no modo torcidas/facзгo [Ex: ! Olб] -
zSuYaNw - 14.05.2013
Quote:
Originally Posted by .FuneraL.
pawn Код:
public OnPlayerText(playerid, text[]) { new String[250], Nome[24]; GetPlayerName(playerid, Nome, 24); if(text[0] == '!') { format(String, sizeof(String), "[Chat Torcida %d]: %s (%d): %s", PlayerInfo[playerid][pTorcidas], Nome, playerid, text[1]); for(new i; i < MAX_PLAYERS; i++) { if(PlayerInfo[playerid][pTorcidas] == PlayerInfo[i][pTorcidas]) { SendClientMessage(i, -1, String); } } } return 1; }
Simplesmente isso, nгo precisa complicar muito 
|
E se ele nгo digitar "!texto" ?
Re: Criando chat no modo torcidas/facзгo [Ex: ! Olб] -
ZePequeno - 14.05.2013
Quote:
Originally Posted by .FuneraL.
pawn Код:
public OnPlayerText(playerid, text[]) { new String[250], Nome[24]; GetPlayerName(playerid, Nome, 24); if(text[0] == '!') { format(String, sizeof(String), "[Chat Torcida %d]: %s (%d): %s", PlayerInfo[playerid][pTorcidas], Nome, playerid, text[1]); for(new i; i < MAX_PLAYERS; i++) { if(PlayerInfo[playerid][pTorcidas] == PlayerInfo[i][pTorcidas]) { SendClientMessage(i, -1, String); } } } return 1; }
Simplesmente isso, nгo precisa complicar muito 
|
Porque faz isso funeral? ;cc
Re: Criando chat no modo torcidas/facзгo [Ex: ! Olб] -
.FuneraL. - 14.05.2013
Quote:
Originally Posted by zSuYaNw
E se ele nгo digitar "!texto" ?
|
Aн vai sair sу o nick do player, nгo vai sair texto, pelo menos eu deixo assim no meu, pelo menos deixava, atй retirar as gangs :C
#Edit - Sу colocar "
if(!strlen(text[1])) return..."
#Edit 2 - Se bem que teria que retornar 0, pra nгo enviar a mensagem alйm do "chat especial" no chat tambйm.
Re: Criando chat no modo torcidas/facзгo [Ex: ! Olб] -
zSuYaNw - 14.05.2013
pawn Код:
public OnPlayerText(playerid, text[]) {
new String[250], Nome[24]; // Variбveis ficaram avulsas caso a condiзгo a baixo returnar false.
GetPlayerName(playerid, Nome, 24); //
if(text[0] == '!') {
format(String, sizeof(String), "[Chat Torcida %d]: %s (%d): %s", PlayerInfo[playerid][pTorcidas], Nome, playerid, text[1]);
for(new i; i < MAX_PLAYERS; i++) {
if(PlayerInfo[playerid][pTorcidas] == PlayerInfo[i][pTorcidas]) {
SendClientMessage(i, -1, String);
}
}
}
return 1;
}
Re: Criando chat no modo torcidas/facзгo [Ex: ! Olб] -
ZePequeno - 14.05.2013
Quote:
Originally Posted by zSuYaNw
E se ele nгo digitar "!texto" ?
|
nгo tem como ele errar o comando shauhsauh, se ele digitar !oi vai funfar do mesmo jeito se ele digita ! oi vai funfar se ele digita !/creditos vai sair no chat /creditos entendeu ?
Quote:
Originally Posted by .FuneraL.
Aн vai sair sу o nick do player, nгo vai sair texto, pelo menos eu deixo assim no meu, pelo menos deixava, atй retirar as gangs :C
#Edit - Sу colocar "if(!strlen(text[1])) return..."
|
do modo que vocк colocou nгo funfa pra gamemodes de torcidas/facзхes nуs criamos ele de um modo que sу nуs sabesmo SOAKSOAKSO, tipo RPG = ZCMD + DOF2, TORCIDAS/FACЗХES = STRCMP + DINI e as org й de um outro modo nгo й igual RPG e tal por isso o comando ta assim daquele jeito (:
Re: Criando chat no modo torcidas/facзгo [Ex: ! Olб] -
.FuneraL. - 14.05.2013
Quote:
Originally Posted by zSuYaNw
pawn Код:
public OnPlayerText(playerid, text[]) { new String[250], Nome[24]; // Variбveis ficaram avulsas caso a condiзгo a baixo returnar false. GetPlayerName(playerid, Nome, 24); // if(text[0] == '!') { format(String, sizeof(String), "[Chat Torcida %d]: %s (%d): %s", PlayerInfo[playerid][pTorcidas], Nome, playerid, text[1]); for(new i; i < MAX_PLAYERS; i++) { if(PlayerInfo[playerid][pTorcidas] == PlayerInfo[i][pTorcidas]) { SendClientMessage(i, -1, String); } } } return 1; }
|
Ah sim, entendi
Re: Criando chat no modo torcidas/facзгo [Ex: ! Olб] -
xRaZeR - 14.05.2013
Porque Vocк Ja nгo Ensinou Como Faz as Torcidas.
Respuesta: Criando chat no modo torcidas/facзгo [Ex: ! Olб] -
DanDRT - 14.05.2013
PHP код:
if(PlayerInfo[i][pTorcidas] == 1)
To Comeзando a Acreditar que vocк fez, Ja Vi Isso em um GM de CAMP da GT...