Police robbery alert problems
#1

Hey guys, I would like to tell you about my problem. I have a problem with the police robbery alert.
In my server, I have 5 law enforcement agency. DRT, COP, SWAT, FBI, ARMY.
I had this problem after I added DRT team!

This is my SendRadioMessageToCops stock.
pawn Код:
stock SendRadioMessageToCops(const str[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerSpawned(i) && gTeam[i] == COP && gTeam[i] == DRT && gTeam[i] == SWAT && gTeam[i] == FBI && gTeam[i] == ARMY) SendClientMessage(i, LIGHT_BLUE, str);
    }
    return true;
}
Is there any problems here, I don't think so right? All law enforcement agencies doesn't get robbery alert! Even COP team

But when I do..

stock SendRadioMessageToCops(const str[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerSpawned(i) && gTeam[i] == COP) SendClientMessage(i, LIGHT_BLUE, str);
}
return true;
}

then the police Robbery alert works for COP team! But the other law enforcement agencies not.

Please help.
Reply
#2

Try this

pawn Код:
stock SendRadioMessageToCops(const str[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerSpawned(i) && (gTeam[i] == COP || gTeam[i] == DRT || gTeam[i] == SWAT || gTeam[i] == FBI || gTeam[i] == ARMY)) SendClientMessage(i, LIGHT_BLUE, str);
    }
    return true;
}
Reply
#3

Quote:
Originally Posted by Skimmer
Посмотреть сообщение
Try this

pawn Код:
stock SendRadioMessageToCops(const str[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerSpawned(i) && (gTeam[i] == COP || gTeam[i] == DRT || gTeam[i] == SWAT || gTeam[i] == FBI || gTeam[i] == ARMY)) SendClientMessage(i, LIGHT_BLUE, str);
    }
    return true;
}
Thanks alot, it works. +rep for you.
What does actually || means?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)