TEAMRADIO
#3

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);
            }
        }
    }
}
Reply


Messages In This Thread
TEAMRADIO - by cray1100 - 13.08.2013, 20:45
Re: TEAMRADIO - by Vanter - 13.08.2013, 20:53
Re: TEAMRADIO - by cray1100 - 13.08.2013, 23:24

Forum Jump:


Users browsing this thread: 1 Guest(s)