SA-MP Forums Archive
onplayerentervehicle - 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 (/showthread.php?tid=203536)



onplayerentervehicle - Pooh7 - 27.12.2010

How to detect in OnPlayerEnterVehicle if player pressed G to enter as passenger?
And what is ID of this key?


Re: onplayerentervehicle - Ironboy500[TW] - 27.12.2010

OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)

You can see "ispassenger" parameter, so you can add simple check under OnPlayerEnterVehicle

Код:
if(ispassenger)
{
  //Code you want to execute if he entered as passenger
}



Re: onplayerentervehicle - Sascha - 27.12.2010

to detect if the player used G use:
pawn Код:
OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(ispassenger(playerid))
    {
        //write code here
    }
    return 1;
}
as far as I know you can't detect the "G" key as you could e.g. detect the "ENTER" key...
G is not used in the singleplayer and you can't change the key to any other...

Edit: hehe ironboy was faster


Re: onplayerentervehicle - Pooh7 - 27.12.2010

Thanks guys.