Wanted color. How can this possibly be wrong? xP
#1

Hey guys. I have a public that has to set your color to your team color.
But it must set it to darkred if you are a suspect.

Now if you are a grove member it perfectly sets your color to green or to darkred if you are a suspect.
But when I'm not in any faction my name is white. And when I want to make him suspect then, his name flashes from white to darkred but it has to stay on darkred till the wantedlevel is gone.

please help

pawn Код:
public teamcolor(playerid)
{
if(GetPlayerWantedLevel(playerid) >=1)
{
SetPlayerColor(playerid,COLOR_DARKRED);
return 1;
}
if(cop[playerid] >=1) SetPlayerColor(playerid,COLOR_BLUE);
else
if(grove[playerid] >=1) SetPlayerColor(playerid,COLOR_GREEN);
else
if(civ[playerid] >=1) SetPlayerColor(playerid,COLOR_WHITE);

return 1;
}
Reply
#2

Quote:
Originally Posted by bartje01
Посмотреть сообщение
Hey guys. I have a public that has to set your color to your team color.
But it must set it to darkred if you are a suspect.

Now if you are a grove member it perfectly sets your color to green or to darkred if you are a suspect.
But when I'm not in any faction my name is white. And when I want to make him suspect then, his name flashes from white to darkred but it has to stay on darkred till the wantedlevel is gone.

please help

pawn Код:
public teamcolor(playerid)
{
if(GetPlayerWantedLevel(playerid) >=1)
{
SetPlayerColor(playerid,COLOR_DARKRED);
return 1;
}
if(cop[playerid] >=1) SetPlayerColor(playerid,COLOR_BLUE);
else
if(grove[playerid] >=1) SetPlayerColor(playerid,COLOR_GREEN);
else
if(civ[playerid] >=1) SetPlayerColor(playerid,COLOR_WHITE);

return 1;
}
Try:
pawn Код:
public teamcolor(playerid)
{
if(GetPlayerWantedLevel(playerid) >=1)
{
SetPlayerColor(playerid,COLOR_DARKRED);
return 1;
}
else
{
if(cop[playerid] >=1) SetPlayerColor(playerid,COLOR_BLUE);
else
if(grove[playerid] >=1) SetPlayerColor(playerid,COLOR_GREEN);
else
if(civ[playerid] >=1) SetPlayerColor(playerid,COLOR_WHITE);
}

return 1;
}
Reply
#3

Still doesn't work :[
Reply
#4

Quote:
Originally Posted by bartje01
Посмотреть сообщение
Still doesn't work :[
Please again explain whats going wrong
Reply
#5

Alright.

When someone isn't in any faction their variable is "civ"

And when I want to make someone wanted when he is a civ his name is flashing from white to darkred and then again to white and so it goes on.

But when he is a grove member it works fine.
Reply
#6

PROBLEM SOLVED.!!

I had another timer that was setting my name to white ! xD
I'm so stupid xP

Thanks for helping though.!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)