13.08.2013, 23:24
(
Последний раз редактировалось cray1100; 13.08.2013 в 23:46.
Причина: Yours didnt work, but i tweaked it a little, and fixed it!
)
I had to tweak it a little, it didnt work... But after that, i combined them into this, and set it to my servers teams!
pawn Код:
CMD:r(playerid, params[])
{
if(GetPlayerTeam(playerid) == 2)
{
new pname[MAX_PLAYER_NAME];
new string[126];
GetPlayerName(playerid,pname,sizeof(pname));
format(string,sizeof(string),"[Sith-Radio] %s(%d): %s",pname,playerid,params);
SendTeam2Message(0xFF0000FF,string);
}
else if(GetPlayerTeam(playerid) == 1)
{
new pname[MAX_PLAYER_NAME];
new string[126];
GetPlayerName(playerid,pname,sizeof(pname));
format(string,sizeof(string),"[Jedi-Radio] %s(%d): %s",pname,playerid,params);
SendTeam1Message(0xFF0000FF,string);
}
return 1;
}
pawn Код:
forward SendTeam1Message(color, string[]);
public SendTeam1Message(color, string[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(GetPlayerTeam(i) == 1)
{
SendClientMessage(i, 0x0000FFFF, string);
}
}
}
}
forward SendTeam2Message(color, string[]);
public SendTeam2Message(color, string[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(GetPlayerTeam(i) == 2)
{
SendClientMessage(i, 0xFF0000FF, string);
}
}
}
}