25.08.2011, 17:00
(
Последний раз редактировалось iggy1; 25.08.2011 в 17:20.
Причина: added connection check
)
Here is an example using OnPlayerText Callback. Anything after '#' is typed will be sent to that players gang.
EDIT: I forgot to return zero, that's fixed now.
pawn Код:
public OnPlayerText(playerid, text[])
{
if(text[0] == '#')
{
new
szStr[128],
szPName[MAX_PLAYER_NAME];
GetPlayerName(playerid, szPName, MAX_PLAYER_NAME);
format(szStr, sizeof(szStr), "|TEAM| (%d)%s: %s", playerid, szPName, text[1]);
for(new i; i < MAX_PLAYERS; i++)//if you use foreach use that, if you don't - then you should start.
if(IsPlayerConnected(i))
if(gTeam[playerid] == gTeam[i])//swap "gTeam" for the var you use to store the players gang/team.
SendClientMessage(playerid, 0x00FF00AA, szStr);
return 0;
}
return 1;
}