Chat Torcida -
denis15711 - 17.10.2012
Alguem me ajuda ae ja tentei de varias formas mais nunca da certo olhem ai
Deste Jeito :
pawn Код:
public OnPlayerText(playerid, text[])
{
if(text[0] == '!')
{
if(PlayerInfo[playerid][pTorcida] == 1)
{
new Nome[24], String[128];
GetPlayerName(playerid, Nome, sizeof(Nome));
format(String, sizeof(String), "[Chat Gaviхes da Fiel]%s(%d): {FFFFFF}%s", Nome,playerid, text[1]);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[playerid][pTorcida] == 1)
{
SendClientMessage(i, COLOR_TVP, String);
}
}
}
if(PlayerInfo[playerid][pTorcida] == 2)
{
new Nome[24], String[128];
GetPlayerName(playerid, Nome, sizeof(Nome));
format(String, sizeof(String), "[Chat Torcida Coringгo Chopp]%s(%d): {FFFFFF}%s", Nome,playerid, text[1]);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[playerid][pTorcida] == 2)
{
SendClientMessage(i, COLOR_TVP, String);
}
}
}
return 0;
}
return 1;
}
Neste ele aparece o chat para todo mundo tipow se o player й da Gavioes da Fiel o chat da GDF aparece na TCC e da TCC aparece na GDF tem outro q eu fiz tbm mais n deu certo
pawn Код:
public OnPlayerText(playerid, text[])
{
if(PlayerInfo[playerid][pTorcida] == 1 && text[0] == '!' )
{
new nome[MAX_PLAYER_NAME],string[180];
GetPlayerName(playerid,nome,sizeof(nome));
format(string,sizeof(string),"[Chat Gaviхes da Fiel]%s : {FFFFFF}%s",nome,text[1]);
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if(PlayerInfo[i][pTorcida] == 1){
SendClientMessage(i, -1,string);
}
}
return 0;
}
if(PlayerInfo[playerid][pTorcida] == 2)
{
new nome[MAX_PLAYER_NAME],string[180];
GetPlayerName(playerid,nome,sizeof(nome));
format(string,sizeof(string),"[Chat Torcida Coringгo Chopp]%s : {FFFFFF}%s",nome,text[1]);
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if(PlayerInfo[i][pTorcida] == 2)
{
SendClientMessage(i, -1,string);
}
}
return 0;
}
return 1;
}
O Caso desse que a 2° Torcida [ Torcida Coringгo Chopp ] Fala no chat da Torcida mais nao fala no Chat normal e a Gaviхes da Fiel ja fala normal fala no CHAT Da Torcida e Chat Normal e este Cуdigo nгo aparece para outros membros de outras TORCIDA igual no primeiro Cуdigo que postei /\ A cima Quem poder me ajudar me manda por MP vlw --'
Re: Chat Torcida -
MatheusAlcapone - 17.10.2012
pawn Код:
public OnPlayerText(playerid, text[])
{
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if(PlayerInfo[i][pTorcida] == 1 && text[0] == '!' )
{
new nome[MAX_PLAYER_NAME],string[180];
GetPlayerName(i,nome,sizeof(nome));
format(string,sizeof(string),"[Chat Gaviхes da Fiel]%s : {FFFFFF}%s",nome,text[1]);
if(PlayerInfo[i][pTorcida] == 1)
{
SendClientMessage(i, -1,string);
return 0;
}
}
if(PlayerInfo[i][pTorcida] == 2)
{
new nome[MAX_PLAYER_NAME],string[180];
GetPlayerName(i,nome,sizeof(nome));
format(string,sizeof(string),"[Chat Torcida Coringгo Chopp]%s : {FFFFFF}%s",nome,text[1]);
if(PlayerInfo[i][pTorcida] == 2)
{
SendClientMessage(i, -1,string);
return 0;
}
}
}
return 0;
}
Re: Chat Torcida -
denis15711 - 17.10.2012
Vou testar ja dou um edit aki
Re: Chat Torcida -
MatheusAlcapone - 17.10.2012
Ok. E adicione o text[0] == '!' na segunda torcida tambem
Re: Chat Torcida -
zSuYaNw - 17.10.2012
PHP код:
public OnPlayerText(playerid, text[])
{
if(text[0] == '!')
{
if(PlayerInfo[playerid][pTorcida] == 1)
{
static
Nome[24],
String[128]
;
Nome[0] = EOS;
String[0] = EOS;
GetPlayerName(playerid, Nome, sizeof(Nome));
format(String, sizeof(String), "[Chat Gaviхes da Fiel]%s(%d): {FFFFFF}%s", Nome,playerid, text[1]);
static
id
;
id = GetMaxPlayers();
for( ; id > -1; --id){
if(PlayerInfo[id][pTorcida] == 1){
SendClientMessage(id, COLOR_TVP, String);
}
}
}
if(PlayerInfo[playerid][pTorcida] == 2)
{
static
Nome[24],
String[128]
;
Nome[0] = EOS;
String[0] = EOS;
GetPlayerName(playerid, Nome, sizeof(Nome));
format(String, sizeof(String), "[Chat Torcida Coringгo Chopp]%s(%d): {FFFFFF}%s", Nome,playerid, text[1]);
static
id
;
id = GetMaxPlayers();
for( ; id > -1; --id){
if(PlayerInfo[id][pTorcida] == 2){
SendClientMessage(id, COLOR_TVP, String);
}
}
}
return 0;
}
return 1;
}
Re: Chat Torcida -
rodrigooo - 17.10.2012
e de qual gamemode esse de torcida ? pode me mandar ?
Re: Chat Torcida -
denis15711 - 17.10.2012
Nгo deu certo garfild
Re: Chat Torcida -
GTO.DoDo - 27.10.2012
Kara, Nem Precisa usar Tantos If's '-'