public OnPlayerText(playerid, text[])
{
new string[128], tmpname[MAX_PLAYER_NAME];
if(text[0] == '#')
{
GetPlayerName(playerid, tmpname, sizeof(tmpname));
if(gTeam[playerid] == TEAM_MEDIC)format(string, sizeof(string), "[Team Chat]%s(%d): %s", tmpname,playerid, text[1]); // Specify which gTeams you need this for.
if(gTeam[playerid] == TEAM_COP)format(string, sizeof(string), "[Team Chat]%s(%d): %s", tmpname,playerid, text[1]); // Specify which gTeams you need this for. for(new i = 0; i < MAX_PLAYERS; i++)
{
for(new i=0;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i) && GetPlayerTeam(i) == GetPlayerTeam(playerid)) SendClientMessage(i, oranje, string);
return 0;
}
}
return 0;
}
return 0;
}
Originally Posted by `FuTuRe-
pawn Код:
|
if(strfind(text, "#", true)==0)
public OnPlayerText(playerid, text[])
{
if(text[0] == '#')
{
if(gTeam[playerid] == TEAM_MEDIC || gTeam[playerid] == TEAM_COP)
{
new string[128], tmpname[MAX_PLAYER_NAME];
GetPlayerName(playerid, tmpname, sizeof(tmpname));
format(string, sizeof(string), "[Team Chat]%s(%d): %s", tmpname,playerid, text[1]);
for(new i=0;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i) && GetPlayerTeam(i) == GetPlayerTeam(playerid))
{
SendClientMessage(i, oranje, string);
}
return 0;
}
}
return 0;
}
return 1;
}
public OnPlayerText(playerid, text[])
{
if (pmuted[playerid]== 1 ) return 0;
new string[256];
{
if(text[0] == '@')
{
if(pInfo[playerid][level] > 0)
{
format(string, sizeof(string), "[Admin Chat] %s(%i): %s", pInfo[playerid][name], playerid, text[1]);
for(new j = 0; j < MAX_PLAYERS; j++)
{
if(IsPlayerConnected(j) && pInfo[j][level] > 0) SendClientMessage(j, ADMIN, string);
}
}
else SendClientMessage(playerid,oranje,"You aren't admin!");
return 0;
}
new textstring[256];
format(textstring, sizeof(textstring), "%s(%i): %s", pInfo[playerid][name],playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid),textstring);
}
return 0;
}
public OnPlayerText(playerid, text[])
{
if(text[0] == '#')
{
if(gTeam[playerid] == TEAM_MEDIC || gTeam[playerid] == TEAM_COP)
{
new string[128], tmpname[MAX_PLAYER_NAME];
GetPlayerName(playerid, tmpname, sizeof(tmpname));
format(string, sizeof(string), "[Team Chat]%s(%d): %s", tmpname,playerid, text[1]);
for(new i=0;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i) && GetPlayerTeam(i) == GetPlayerTeam(playerid))
{
SendClientMessage(i, oranje, string);
}
return 0;
}
}
return 0;
}
return 1;
}
static gTeam[MAX_PLAYERS];
public OnPlayerText(playerid, text[]) { new string[256]; new playername[MAX_PLAYER_NAME]; if(text[0] == '!' && text[1] != 0) { GetPlayerName( playerid, playername, MAX_PLAYER_NAME ); format( string, 128, "[Team] %s: %s", playername, text[1] ); for(new i = 0; i < MAX_PLAYERS; i++ ) { if( IsPlayerConnected(i) && gTeam[playerid] == gTeam[i] ) SendClientMessage( i, YourColor, string ); } return 0; } return 1; }