SA-MP Forums Archive
[HELP]Team Chat - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP]Team Chat (/showthread.php?tid=162813)



[HELP]Team Chat - hekoxz - 24.07.2010

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?