24.07.2014, 19:05
Galera fiz um chat para as organizaзхes, no onplayertext, mais nгo da pra falar sem ser no chat se digitar sem o comando do chat nгo aparece nada, dps vocк digita um texto com o comando e funciona ! alguйm me ajuda
new String[180];
new Nome[MAX_PLAYER_NAME];
GetPlayerName(playerid,Nome,sizeof(Nome));
if(text[0] == '!')
{
for(new i=0; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[playerid][pCivil] == 1)
{
format(String,sizeof(String),"[Chat Civis] %s (%d): {FFFFFF}%s", Nome,playerid, text[1]);
if(PlayerInfo[i][pCivil] == 1)
SendClientMessage(i,COR_AMARELO,String);
}
public OnPlayerText(playerid, text[])
{
new String[180];
new Nome[MAX_PLAYER_NAME];
GetPlayerName(playerid,Nome,sizeof(Nome));
if(text[0] == '!')
return 0;
{
for(new i=0; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[playerid][pCivil] == 1)
{
format(String,sizeof(String),"[Chat Civil] %s (%d): {FFFFFF}%s", Nome,playerid, text[1]);
if(PlayerInfo[i][pCivil] == 1)
SendClientMessage(i,COR_Civil,String);
}
if(PlayerInfo[playerid][pReporteres] == 2)
{
format(String,sizeof(String),"[Chat Reporteres] %s (%d): {FFFFFF}%s", Nome,playerid, text[1]);
if(PlayerInfo[i][pReporteres] == 2)
SendClientMessage(i,COR_REPORTERS,String);
}
}
return 1;
}