How to let police see only?
#1

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?
Reply
#2

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.
Reply
#3

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

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

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

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?
Reply
#7

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;
}
Reply
#8

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?
Reply
#9

How i do this plese?
Reply
#10

can anyone help!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)