SA-MP Forums Archive
Anyway how to do this wanted color for cops to see - 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: Anyway how to do this wanted color for cops to see (/showthread.php?tid=586503)



Anyway how to do this wanted color for cops to see - DerickClark - 22.08.2015

- Fixed.


Re: Anyway how to do this wanted color for cops to see - Logofero - 22.08.2015

PHP код:
if(Team[playerid] == TEAM_COP)
{
     for(new 
GetPlayerPoolSize(); >= 0; --p) {
      if(
GetPlayerWantedLevel(p) >= 1) {
        
SetPlayerMarkerForPlayer(pplayerid0xFF0000FF);
     } else if(
GetPlayerWantedLevel(p) == 0) {
        
SetPlayerMarkerForPlayer(pplayeridCOLOUR_RED); // This is default color! Removed you team color
        
}
    }




Re: Anyway how to do this wanted color for cops to see - DerickClark - 22.08.2015

I mean when i type /duty it will show the wanted color. when i type /duty again it won't show the wanted players.

and i got it like this

Код:
     if(Team[playerid] == TEAM_COP)
     {
     for(new p = GetPlayerPoolSize(); p >= 0; --p) {
     if(GetPlayerWantedLevel(p) >= 1)
	 {
        SetPlayerColor(playerid,COLOUR_RED);
        SetPlayerMarkerForPlayer(p, playerid, 0xFF0000FF);
     }
	 else if(GetPlayerWantedLevel(p) == 0)
	 {
        SetPlayerMarkerForPlayer(p, playerid, COLOUR_RED); // This is default color! Removed you team color
        SetPlayerMarkerForPlayer(p, playerid, COLOUR_RED);
        SetPlayerToTeamColour(playerid);
        }
     }
     }



Re: Anyway how to do this wanted color for cops to see - Logofero - 22.08.2015

Quote:
Originally Posted by DerickClark
Посмотреть сообщение
I mean when i type /duty it will show the wanted color. when i type /duty again it won't show the wanted players.
PHP код:
if(Team[playerid] == TEAM_COP)
{
     for(new 
GetPlayerPoolSize(); >= 0; --p) {
      if(
GetPlayerWantedLevel(p) >= && PoliceDuty[playerid]) { // If is Add it work?
        
SetPlayerMarkerForPlayer(pplayerid0xFF0000FF);
     } else if(
GetPlayerWantedLevel(p) == 0) {
        
SetPlayerMarkerForPlayer(pplayeridCOLOUR_RED); // This is default color! Removed you team color
        
}
    }




Re: Anyway how to do this wanted color for cops to see - DerickClark - 22.08.2015

It's working but when i type /duty 2 times. i'm off duty but the color not resting to
Код:
SetPlayerToTeamColour
Код:
if(Team[playerid] == TEAM_COP)
     {
     for(new p = GetPlayerPoolSize(); p >= 0; --p) {
      if(GetPlayerWantedLevel(p) >= 1 && PoliceDuty[playerid])
	  { // If is Add it work?
        SetPlayerColor(playerid,COLOUR_RED);
        SetPlayerMarkerForPlayer(p, playerid, 0xFF0000FF);
     }
	 else if(GetPlayerWantedLevel(p) == 0)
	 {
        SetPlayerMarkerForPlayer(p, playerid, COLOUR_RED); 
        SetPlayerToTeamColour(p);
        }
     }
     }



Re: Anyway how to do this wanted color for cops to see - Logofero - 22.08.2015

Quote:
Originally Posted by DerickClark
Посмотреть сообщение
It's working but when i type /duty 2 times. i'm off duty but the color not resting to
Код:
SetPlayerToTeamColour
Код:
if(Team[playerid] == TEAM_COP)
     {
     for(new p = GetPlayerPoolSize(); p >= 0; --p) {
      if(GetPlayerWantedLevel(p) >= 1 && PoliceDuty[playerid])
	  { // If is Add it work?
        SetPlayerColor(playerid,COLOUR_RED);
        SetPlayerMarkerForPlayer(p, playerid, 0xFF0000FF);
     }
	 else if(GetPlayerWantedLevel(p) == 0)
	 {
        SetPlayerMarkerForPlayer(p, playerid, COLOUR_RED); 
        SetPlayerToTeamColour(p);
        }
     }
     }
PHP код:
if(Team[playerid] == TEAM_COP)
     {
     for(new 
GetPlayerPoolSize(); >= 0; --p) {
      if(
GetPlayerWantedLevel(p) >= && PoliceDuty[playerid])
      { 
// If is Add it work?
        
SetPlayerColor(playerid,COLOUR_RED);
        
SetPlayerMarkerForPlayer(pplayerid0xFF0000FF);
     }
     else if(
GetPlayerWantedLevel(p) == || !PoliceDuty[playerid] ) // Teste it
     
{
        
SetPlayerMarkerForPlayer(pplayeridCOLOUR_RED); // This is default color! Removed you team color
        
SetPlayerToTeamColour(p);
        }
     }
     } 



Re: Anyway how to do this wanted color for cops to see - DerickClark - 22.08.2015

Thanks working perfect.


Re: Anyway how to do this wanted color for cops to see - DerickClark - 22.08.2015

Quote:
Originally Posted by Logofero
Посмотреть сообщение
PHP код:
if(Team[playerid] == TEAM_COP)
     {
     for(new 
GetPlayerPoolSize(); >= 0; --p) {
      if(
GetPlayerWantedLevel(p) >= && PoliceDuty[playerid])
      { 
// If is Add it work?
        
SetPlayerColor(playerid,COLOUR_RED);
        
SetPlayerMarkerForPlayer(pplayerid0xFF0000FF);
     }
     else if(
GetPlayerWantedLevel(p) == || !PoliceDuty[playerid] ) // Teste it
     
{
        
SetPlayerMarkerForPlayer(pplayeridCOLOUR_RED); // This is default color! Removed you team color
        
SetPlayerToTeamColour(p);
        }
     }
     } 
How to fix the code current that how the code look messes


Re: Anyway how to do this wanted color for cops to see - Logofero - 22.08.2015

Quote:
Originally Posted by DerickClark
Посмотреть сообщение
How to fix the code current that how the code look messes
Not quite understand you.
You mean to have cops and criminals were different colors when searching for?

Cops == COLOR_BLUE
Criminals == COLOR_RED ?


Re: Anyway how to do this wanted color for cops to see - DerickClark - 22.08.2015

I mean look at the code it look mess up. this code don't look mess up

Код:
if(Team[playerid] == TEAM_COP) 
{ 
     for(new p = GetPlayerPoolSize(); p >= 0; --p) { 
      if(GetPlayerWantedLevel(p) >= 1 && PoliceDuty[playerid]) { // If is Add it work? 
        SetPlayerMarkerForPlayer(p, playerid, 0xFF0000FF); 
     } else if(GetPlayerWantedLevel(p) == 0) { 
        SetPlayerMarkerForPlayer(p, playerid, COLOUR_RED); // This is default color! Removed you team color 
        } 
    } 
}