OnPlayerEnterVehicle help
#1

This sounds stupid, but I seem to be stuck.

If I want to add a custom string to display a certain text as a player enters a certain vehicle, with the larger-type text, how would I do so?

For instance, if someone enters vehicle ID 500 and I want it to say in big text for about 3-5 seconds "I love you," or something like that, how would I do so?

Thanks!
Reply
#2

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
  if(vehicleid == 500 && !ispassenger) // Entering vehicle id 500 as driver
  {  
    // Text
  }
 
  return 1;
}
https://sampwiki.blast.hk/wiki/GameTextForPlayer
Reply
#3

So, something like this:

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
  if(vehicleid == 541 && !ispassenger)
  {
    new string[50];
    format(string, sizeof(string), "Uhhm? Text...", vehicleid);
    GameTextForPlayer(playerid, string, 3000, 4);
  }

  return 1;
}
However, when I spawn vehicle ID number 541 in game, and get in the driver seat...it does nothing.
Reply
#4

vehicle ID or model ID? There is a difference and people get confused about that constantly
Reply
#5

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
  if(GetVehicleModel(vehicleid)==500&&!ispassenger) // Entering vehicle id 500 as driver
  {  
    // Text
  }
  return 1;
}
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)