PDA

View Full Version : How to let police see only?


TheDiscussionCafe
28/04/2012, 02:55 AM
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?

SuperViper
28/04/2012, 03:29 AM
Replace your whole OnPlayerText with this:

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

#include <foreach>

at the top of your script.

TheDiscussionCafe
28/04/2012, 03:35 AM
What about color above player heads? And how i can make for zcmd?

SuperViper
28/04/2012, 03:39 AM
ZCMD has nothing to do with text, so just leave it like that. For setting the colors above the player's head, use SetPlayerColor.

Ballu Miaa
28/04/2012, 03:42 AM
The color over Player heads are done by SetPlayerColor native function. Search wiki for it.

TheDiscussionCafe
28/04/2012, 04:44 AM
ZCMD has nothing to do with text, so just leave it like that. For setting the colors above the player's head, use SetPlayerColor.

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?

Ballu Miaa
28/04/2012, 05:01 AM
Use it like this: Just a working example
public OnPlayerSpawn(playerid)
{
if(gTeam[playerid] == Team_Civi) return SetPlayerColor(playerid, 0x1f3ccdcf);
if(gTeam[playerid] == Team_Cop) return SetPlayerColor(playerid, 0xFFFFFFAA);
return 1;
}

TheDiscussionCafe
28/04/2012, 07:10 AM
Use it like this: Just a working example
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?

TheDiscussionCafe
28/04/2012, 02:14 PM
How i do this plese?

TheDiscussionCafe
28/04/2012, 06:04 PM
can anyone help!

JAMMIEISFTW
28/04/2012, 06:10 PM
Im using this :P

TheDiscussionCafe
28/04/2012, 06:44 PM
Im using this :P

does it work for u?