SA-MP Forums Archive
How to let police see only? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to let police see only? (/showthread.php?tid=337847)



How to let police see only? - TheDiscussionCafe - 28.04.2012

I have gTeam = Team_Cop and gTeam = Team_Civi

How can I make Team_Civi see everyone's names from chat and from screen to white all the time and for Team_Cop, they can see if player is wanted or not. Even if players from Team_Civi is wanted with many stars, other Team_Civi players cannot see, only Team_Cop players. How to do?


Re: How to let police see only? - SuperViper - 28.04.2012

Replace your whole OnPlayerText with this:

pawn Код:
public OnPlayerText(playerid, text[])
{
    if(GetPlayerWantedLevel(playerid) > 0)
    {
        new string[128], playersName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, playersName, sizeof(playersName));
        foreach(new i: Player)
        {
            if(gTeam[playerid] == Team_Civi)
            {
                format(string, sizeof(string), "%s{FFFFFF}: %s", playersName, text);
            }
            else if(gTeam[playerid] == Team_Cop)
            {
                format(string, sizeof(string), "[WANTED] %s{FFFFFF}: %s", playersName, text);
            }

            SendClientMessage(i, GetPlayerColor(playerid), string);
        }
        return 0;
    }
    else
    {
        return 1;
    }
}
and make sure you have the foreach plugin by ****** and have

pawn Код:
#include <foreach>
at the top of your script.


Re: How to let police see only? - TheDiscussionCafe - 28.04.2012

What about color above player heads? And how i can make for zcmd?


Re: How to let police see only? - SuperViper - 28.04.2012

ZCMD has nothing to do with text, so just leave it like that. For setting the colors above the player's head, use SetPlayerColor.


Re: How to let police see only? - Ballu Miaa - 28.04.2012

The color over Player heads are done by SetPlayerColor native function. Search wiki for it.


Re: How to let police see only? - TheDiscussionCafe - 28.04.2012

Quote:
Originally Posted by SuperViper
Посмотреть сообщение
ZCMD has nothing to do with text, so just leave it like that. For setting the colors above the player's head, use SetPlayerColor.
Quote:
Originally Posted by Ballu Miaa
Посмотреть сообщение
The color over Player heads are done by SetPlayerColor native function. Search wiki for it.
I dont get how to do for Team_Cop. help please?


Re: How to let police see only? - Ballu Miaa - 28.04.2012

Use it like this: Just a working example
pawn Код:
public OnPlayerSpawn(playerid)
{
    if(gTeam[playerid] == Team_Civi) return SetPlayerColor(playerid, 0x1f3ccdcf);
    if(gTeam[playerid] == Team_Cop) return SetPlayerColor(playerid, 0xFFFFFFAA);
    return 1;
}



Re: How to let police see only? - TheDiscussionCafe - 28.04.2012

Quote:
Originally Posted by Ballu Miaa
Посмотреть сообщение
Use it like this: Just a working example
pawn Код:
public OnPlayerSpawn(playerid)
{
    if(gTeam[playerid] == Team_Civi) return SetPlayerColor(playerid, 0x1f3ccdcf);
    if(gTeam[playerid] == Team_Cop) return SetPlayerColor(playerid, 0xFFFFFFAA);
    return 1;
}
no that doesnt work. well maybe i have to set how much wanted level or something? how can i do that?


Re: How to let police see only? - TheDiscussionCafe - 28.04.2012

How i do this plese?


Re: How to let police see only? - TheDiscussionCafe - 28.04.2012

can anyone help!