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 : {FFFFFF}%s", Nome, text[1]);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[i][pTorcida] == 1)
{
SendHelperMessage(COLOR_TVP, String);
return 0;
}
}
}
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 : {FFFFFF}%s", Nome, text[1]);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[i][pTorcida] == 2)
{
SendHelperMessage(COLOR_TVP, String);
return 0;
}
}
}
}
}
return 1;
}
public SendHelperMessage(color, string[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pTorcida] == 1)
{
SendClientMessage(i, COLOR_TVP, string);
}
if(PlayerInfo[i][pTorcida] == 2)
{
SendClientMessage(i, COLOR_TVP, string);
}
}
}
printf("[Chat]%s", string);
}// Esta tipow Chat Global
public OnPlayerText(playerid, text[])
{
if(text[0] == '!')
{
new Nome[24], String[128];
GetPlayerName(playerid, Nome, sizeof(Nome));
if(PlayerInfo[playerid][pTorcida] == 1)
format(String, sizeof(String), "[Chat Gaviхes da Fiel] %s : {FFFFFF}%s", Nome, text[1]);
else if(PlayerInfo[playerid][pTorcida] == 2)
format(String, sizeof(String), "[Chat Torcida Coringгo Chopp] %s : {FFFFFF}%s", Nome, text[1]);
SendHelperMessage(COLOR_TVP, String);
return 0;
}
return 1;
}
public SendHelperMessage(color, string[])
{
for(new i, j = GetMaxPlayers(); i != j; i++)
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pTorcida] == 1)
SendClientMessage(i, COLOR_TVP, string);
else if(PlayerInfo[i][pTorcida] == 2)
SendClientMessage(i, COLOR_TVP, string);
}
printf("[Chat]%s", string);
}
Tenta ai
pawn Код:
|
public OnPlayerText(playerid, text[])
{
if(text[0] == '!')
{
new Nome[24], String[128];
GetPlayerName(playerid, Nome, sizeof(Nome));
if(PlayerInfo[playerid][pTorcida] == 1)
format(String, sizeof(String), "[Chat Gaviхes da Fiel] %s : {FFFFFF}%s", Nome, text[1]);
else if(PlayerInfo[playerid][pTorcida] == 2)
format(String, sizeof(String), "[Chat Torcida Coringгo Chopp] %s : {FFFFFF}%s", Nome, text[1]);
SendHelperMessage(playerid, COLOR_TVP, String);
return 0;
}
return 1;
}
public SendHelperMessage(playerid, color, string[])
{
for(new i, j = GetMaxPlayers(); i != j; i++)
if(IsPlayerConnected(i))
if(PlayerInfo[playerid][pTorcida] == PlayerInfo[i][pTorcida])
SendClientMessage(i, COLOR_TVP, string);
printf("[Chat]%s", string);
}
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 : %s", Nome, text[1]);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(VarTorcida[i] == Torcida[playerid])
{
SendClientMessage(i, COLOR_TVP, String);
return 0;
}
}
}
}
return 0;
}