#define TEAM_PAKISTAN 1
#define TEAM_GERMNAY 2
#define TEAM_USA 3
#define TEAM_RUSSIA 4
#define TEAM_INDIA 5
public OnPlayerText(playerid, text[])
{
new strName[MAX_PLAYER_NAME], strOut[129];
GetPlayerName(playerid, strName, sizeof(strName));
if(text[0] == '!') // he used ' ! ' before text in chat box ( change as you wish )
{
new string[129];
strmid(string, text, 1, strlen(text), 129);
format(strOut, 129, "[TeamChat] %s: %s", strName, string);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(gTeam[i] == gTeam[playerid]) // change this if you're not using gTeam
SendClientMessage(i, -1, strOut);
}
return 0; // prevent the message to be sent on global chat
}
return 1;
}
D:\Game\UDC Wars\gamemodes\Wars.pwn(834) : error 017: undefined symbol "gTeam"
D:\Game\UDC Wars\gamemodes\Wars.pwn(834) : warning 215: expression has no effect
D:\Game\UDC Wars\gamemodes\Wars.pwn(834) : error 001: expected token: ";", but found "]"
D:\Game\UDC Wars\gamemodes\Wars.pwn(834) : error 029: invalid expression, assumed zero
D:\Game\UDC Wars\gamemodes\Wars.pwn(834) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.
static gTeam[MAX_PLAYERS];
if(gTeam[i] == gTeam[playerid]) // change this if you're not using gTeam
if(GetPlayerTeam(i) == GetPlayerTeam(playerid))
SendClientMessage(i, -1, strOut); // change ' -1 ' (White) to your color hex like : 0x00FF00FF (Green)
or
SendClientMessage(i, GetPlayerColor(playerid), strOut); // will send in the color of playerid
And one more request as friend. How i add text like " kills : 4 \ Death : 5 \ score : 5"
RANK : Rookie (1) I'll add all ranks by myself. Only teach me how to add. And it will under the money on right top. |