Radio System
#10

This might work and be a bit clearer,
pawn Code:
#define FILTERSCRIPT

#include <a_samp>

// ========= TEAMS START =================
#define Team_Civ 0
#define Team_LVPD 1
#define Team_NSP 2
#define Team_EMS 3
#define Team_Fire 4
#define Team_Admin 5
#define Team_Jail 6
#define Team_Taxi 7


#define COLOR_RED 0xAA3333AA
#define COLOR_YELLOW 0xFFFF00AA

new PlayerTeam[MAX_PLAYERS];

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" VCRP Radio System");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

public OnPlayerText(playerid, text[])
{
    if(text[0] == '!' && PlayerTeam[playerid] == Team_LVPD || PlayerTeam[playerid] == Team_NSP || PlayerTeam[playerid] == Team_EMS || PlayerTeam[playerid] == Team_Fire))
    {
        MessageToCivilTeams(text);
        return 0;
    }
    return 1;
}

stock MessageToCivilTeams(message[])
{
    for(new i; i < MAX_PLAYERS; i++)
    {
        if(!IsPlayerConnected(i))continue;
        if(PlayerTeam[i] == Team_LVPD || PlayerTeam[i] == Team_NSP || PlayerTeam[i] == Team_EMS ||PlayerTeam[i] == Team_Fire)
        {
            SendClientMessage(i,0xB4B5B7AA,message);
        }
    }
}
I hope it works for you. I should of made an "IsPlayerCivilTeam" lol would make that a bit shorter.
Oh and btw i didn't see any code where you set the players team or at least the PlayerTeam variable i hope you have that in the original code :/
Reply


Messages In This Thread
Radio System - by [UG]Scripter - 13.09.2010, 12:59
Re: Radio System - by iggy1 - 13.09.2010, 13:18
Re: Radio System - by [UG]Scripter - 13.09.2010, 13:22
Re: Radio System - by [UG]Scripter - 13.09.2010, 14:10
Re: Radio System - by iggy1 - 13.09.2010, 14:16
Re: Radio System - by [UG]Scripter - 13.09.2010, 15:06
Re: Radio System - by iggy1 - 13.09.2010, 15:09
Re: Radio System - by [UG]Scripter - 13.09.2010, 16:04
Re: Radio System - by [UG]Scripter - 13.09.2010, 16:40
Re: Radio System - by iggy1 - 13.09.2010, 17:18

Forum Jump:


Users browsing this thread: 1 Guest(s)