enter vehicle message?
#1

hello i have made an engine system that works with an key(lmb).
but i also need a message that appears when someone enters a vehicle that they have to press lmb to start the engine.
could enyone explaine how to do this?

thnks already!
Reply
#2

Quote:
Originally Posted by justsomeguy
Посмотреть сообщение
hello i have made an engine system that works with an key(lmb).
but i also need a message that appears when someone enters a vehicle that they have to press lmb to start the engine.
could enyone explaine how to do this?

thnks already!
Use the SendClientMessage and GameTextForPlayer functions under the OnPlayerEnterVehicle callback.

NOTE: Use OnPlayerStateChange if you don't like the message showing before they actually open the door if they enter the vehicle from a distance.

I can type it up if you like but i am sure you could manage now.
Reply
#3

i used onplayerstatechange but the message just didnt show up
Reply
#4

show me that whole callback..
Reply
#5

here's the callback:
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
  new PlayerName[24];
  GetPlayerName(playerid, PlayerName, sizeof(PlayerName));

  if(newstate == PLAYER_STATE_DRIVER)
  {
   new Vehicle = GetPlayerVehicleID(playerid);
   if(Vehicle == justsomeguy)
   { // It is, so we continue.
     if(strcmp(PlayerName,"justsomeguy",true))
     {
      RemovePlayerFromVehicle(playerid);
      SendClientMessage(playerid, 0x33AA33AA, "I'm sorry, but this car has been reserved for justsomeguy");
     }
   }
  }
  return 1;
  if(newstate == PLAYER_STATE_DRIVER) // kijk of de player in een auto stapt als driver
    {
        TogglePlayerControllable(playerid, 0); // freeze hem
        EngineEnabled[playerid] = 0;
        SendClientMessage(playerid, 0xFFFFFFAA, "Press LMB to start the engine."); // stuur hem een bericht
        SetCameraBehindPlayer(playerid); // set de camera achter hem
    }
    return 1;
}
Reply
#6

pawn Код:
}
return 1;
if(newstate == PLAYER_STATE_DRIVER) // kijk of de player in een auto stapt als driver
{
Remove this return 1;

pawn Код:
}
if(newstate == PLAYER_STATE_DRIVER) // kijk of de player in een auto stapt als driver
{
Reply
#7

thanx it works now(also there was a flaw in my engine script its old cuz 0.3 has an engine systemXD)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)