SA-MP Forums Archive
Player Colour Problem - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Player Colour Problem (/showthread.php?tid=74536)



Player Colour Problem - JoeDaDude - 23.04.2009

Hi i have certain car set around my server,
When someone finds the car it changes there name colour,
Althought, So far i have one car thats green, and one thats red,
Although no matter what car i enter its always red,
Does anyone know how to fix this:

pawn Код:
if(vehicleid == CXN130)
    SendClientMessage(playerid, 0xFF0000, "Tail Number C-XN-130");
    SetPlayerColor(playerid, COLOR_GREEN);

    if(vehicleid == MCK345)
    SendClientMessage(playerid, 0xFF0000, "Tail Number M-CK-345");
    SetPlayerColor(playerid, COLOR_RED);
Whats wrong??


Re: Player Colour Problem - OmeRinG - 23.04.2009

show us the variables you created and the
CXN130 = CreateVehicle(...........);


Re: Player Colour Problem - JoeDaDude - 23.04.2009

pawn Код:
MCK345 = CreateVehicle(400,275.8089,1956.2397,18.3662,269.9997,0,0,86400);
pawn Код:
CXN130 = CreateVehicle(400,1995.5193,-2394.2454,13.6517,89.2439,99,26,86400);



Re: Player Colour Problem - lavamike - 23.04.2009

Where are your brackets? { }

pawn Код:
if(vehicleid == CXN130)
{
  SendClientMessage(playerid, 0xFF0000, "Tail Number C-XN-130");
  SetPlayerColor(playerid, COLOR_GREEN);
}

if(vehicleid == MCK345)
{
  SendClientMessage(playerid, 0xFF0000, "Tail Number M-CK-345");
  SetPlayerColor(playerid, COLOR_RED);
}
Maybe that would make it work?

and what is always red the player icon color or the message

if it's the message they both are "0xFF0000" - i don't know what color that is off the top of my head so.

and if it's the player icon color, show us your #defines for COLOR_GREEN and COLOR_RED


Re: Player Colour Problem - GammerZ - 23.04.2009

Did you put that in OnPlayerEnterVehicle Callback?


Re: Player Colour Problem - lavamike - 23.04.2009

Yeah also showing the whole callback (public) would be helpful too


Re: Player Colour Problem - [LCG]TANKER - 23.04.2009

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
  if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) // only work if the player is driver
  {  
    if(vehicleid == CXN130)
    {
      SendClientMessage(playerid, 0xFF0000, "Tail Number C-XN-130"); // send only to driver
      SetPlayerColor(playerid, COLOR_GREEN);
    }
  }
}
UNTESTED but try this



Re: Player Colour Problem - ICECOLDKILLAK8 - 23.04.2009

Put it in OnPlayerStateChange->newstate == PLAYER_STATE_DRIVER