Looping
#5

pawn Код:
#define TEAM_COP 1

forward SendClientMessageToAllCops(msg[]);

new gTeam[MAX_PLAYERS];
new HasLawEnforcementRadio[MAX_PLAYERS];

public OnPlayerRequestClass(playerid, classid)
{
     SetPlayerTeamFromClass(playerid,classid);

    SetPlayerTeamFromClass(playerid,classid)
    {
        if(GetPlayerSkin(playerid) == skin || GetPlayerSkin(playerid) == skin)
        {
            gTeam[playerid] = TEAM_COP;
        }
   }
}

OnPlayerSpawn(playerid)
{
    if(gTeam[playerid] == TEAM_COP)
        {
            HasLawEnforcementRadio[playerid] =1;
        }

}

public SendClientMessageToAllCops(msg[])
{
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
             if(HasLawEnforcementRadio[i] == 1)
             {
                  SendClientMessage(i,Anycolor you want,msg);
             }
        }
    }
}
check if i forgot something tell me

btw i will give you gift:
if you don't want them to kill each other
put this
pawn Код:
SetPlayerTeam(playerid,team id);
under
pawn Код:
HasLawEnforcementRadio[playerid] =1;
Reply


Messages In This Thread
Looping - by AnonScripter - 05.10.2013, 17:46
Re: Looping - by Konstantinos - 05.10.2013, 17:49
Re: Looping - by AnonScripter - 05.10.2013, 18:34
Re: Looping - by Konstantinos - 05.10.2013, 18:59
Re: Looping - by TomatoRage - 05.10.2013, 23:49
Re: Looping - by DanishHaq - 05.10.2013, 23:58
Re: Looping - by AnonScripter - 07.10.2013, 21:01

Forum Jump:


Users browsing this thread: 2 Guest(s)