Posts: 121
Threads: 20
Joined: Oct 2011
Reputation:
0
Hi,
I am wondering how I can make it so when a player gets 1 star, their name automatically changes to yellow, and >= 4 is changed to Orange..
I do understand the concept of the code, and how to do it (I think :P) - But not sure where to position it, under what header and what not :S
Posts: 10,066
Threads: 38
Joined: Sep 2007
Reputation:
0
Funny thing is, you don't even need timers since the wanted level is controlled entirely on the server's side. That means that you know at all times what its value is and when it changes (hook SetPlayerWantedLevel).
Posts: 121
Threads: 20
Joined: Oct 2011
Reputation:
0
Ok, thanks for all that, but I am just wondering..
since I have few classes with different colors, say mechanic is brown, then he goes yellow for crime, but wouldn't he go white instead of brown when cleared?
And since that would require a few 'if' commands, would that lag it more?
My OnPlayerUpdate, is pretty much empty, just a line or two in it
I tried using an if for all the civilians, but says error 075: input line too long (after substitutions), how do I fix this?
Since they are all in teams, like pimp = TEAM_PIMP, Chicken = TEAM_CHICKEN, is it possible to have a variable, where Civilians = Team_XX1, TEAM_XX2, TEAM_ etc etc ?
Posts: 121
Threads: 20
Joined: Oct 2011
Reputation:
0
I am using, seems to work
if(GetPlayerWantedLevel(playerid) == 0 && PlayerInfo[playerid][team] != TEAM_ARMY && PlayerInfo[playerid][team] != TEAM_SWAT && PlayerInfo[playerid][team] != TEAM_LVCOP && PlayerInfo[playerid][team] != TEAM_LVARMY && PlayerInfo[playerid][team] != TEAM_LVSWAT && PlayerInfo[playerid][team] != TEAM_LSCOP && PlayerInfo[playerid][team] !=TEAM_MEDIC && PlayerInfo[playerid][team] != TEAM_LVMEDIC && PlayerInfo[playerid][team] != TEAM_MECHANIC)
{
SetPlayerColor(playerid, COLOR_WHITE);
}
else if(GetPlayerWantedLevel(playerid) == 0 && PlayerInfo[playerid][team] == TEAM_MEDIC && PlayerInfo[playerid][team] == TEAM_LVMEDIC)
{
SetPlayerColor(playerid, COLOR_PINK);
}
else if(GetPlayerWantedLevel(playerid) == 0 && PlayerInfo[playerid][team] == TEAM_MECHANIC)
{
SetPlayerColor(playerid, COLOR_BROWN);
}
else if(GetPlayerWantedLevel(playerid) >= 1 && GetPlayerWantedLevel(playerid) <=3)// between 1 and less than 3 stars, name color changed to yellow
{
SetPlayerColor(playerid, COLOR_YELLOW);
}
else if (GetPlayerWantedLevel(playerid) >=4 )
{
SetPlayerColor(playerid,COLOR_ORANGE); // with 4 or more stars, name color changed to orange
}