24.07.2010, 21:57
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
can anyone help me?
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; } |