Player Colour Problem
#1

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??
Reply
#2

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

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);
Reply
#4

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
Reply
#5

Did you put that in OnPlayerEnterVehicle Callback?
Reply
#6

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

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
Reply
#8

Put it in OnPlayerStateChange->newstate == PLAYER_STATE_DRIVER
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)