[HELP]Team Chat
#1

Hello i am working on this team chat in OnPlayerText, it works but it don't send the message from playerid 0,it don't work just for id 0 with the others ids works perfectly

here is the code

Quote:

public OnPlayerText(playerid,text[])
{
for(new iPlayer = 0; iPlayer < MAX_PLAYERS;iPlayer++)
{
if(InDM[playerid][4] && InDM[iPlayer][4] && GetPlayerTeam(playerid) == GetPlayerTeam(iPlayer))
{
new string[128];
format(string,sizeof(string),"[Radio]:%s",text);
SendPlayerMessageToPlayer(iPlayer,playerid,string) ;
SendPlayerMessageToPlayer(playerid,playerid,string );
return 0;
}
else if(InDM[playerid][5] && InDM[iPlayer][5] && GetPlayerTeam(playerid) == GetPlayerTeam(iPlayer))
{
new string[128];
format(string,sizeof(string),"[Radio]:%s",text);
SendPlayerMessageToPlayer(iPlayer,playerid,string) ;
SendPlayerMessageToPlayer(playerid,playerid,string );
return 0;
}
}
new string[128];
format(string, sizeof(string), "[%d]: %s", playerid, text);
SendPlayerMessageToAll(playerid, string);
return 0;
}
can anyone help me?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)