01.02.2012, 14:08
Ay mate. Well here is what I use
This works perfectly fine with me. Just change "@" to your desired letter for example #. This way it will say
Of course. If you wish to change your team message you should change
to desired text.
For example:
I hope it will help you
+rep
PHP Code:
public OnPlayerText(playerid, text[])
{
if(text[0] == "!" || text[0] == "@")
{
new name[MAX_PLAYER_NAME], msg[128];
GetPlayerName(playerid, name, sizeof(name));
format(msg, sizeof(msg), "[Team Chat] %s[%d]: %s", name, playerid, text[1]);
for(new i; i<=MAX_PLAYERS; i++)
{
if(GetPlayerTeam(playerid) == GetPlayerTeam(i))
{
SendClientMessage(i, TEAMCOLOR, msg);
}
}
return 0;
}
}
PHP Code:
[Team-Chat] MyName: Text
PHP Code:
format(msg, sizeof(msg), "[Team Chat] %s[%d]: %s", name, playerid, text[1]);
For example:
PHP Code:
format(msg, sizeof(msg), "[My Team] %s[%s]: %s", name, playerid, text[1]);
+rep