OnPlayerEnterVehicle help - 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: OnPlayerEnterVehicle help (
/showthread.php?tid=81512)
OnPlayerEnterVehicle help -
spykid1305 - 11.06.2009
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!
Re: OnPlayerEnterVehicle help -
BMUK - 11.06.2009
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
Re: OnPlayerEnterVehicle help -
spykid1305 - 11.06.2009
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.
Re: OnPlayerEnterVehicle help -
kaisersouse - 11.06.2009
vehicle ID or
model ID? There is a difference and people get confused about that constantly
Re: OnPlayerEnterVehicle help -
MenaceX^ - 11.06.2009
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(GetVehicleModel(vehicleid)==500&&!ispassenger) // Entering vehicle id 500 as driver
{
// Text
}
return 1;
}