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



PLAYER_STATE_ENTER_VEHICLE_DRIVER - Woz - 27.12.2010

PLAYER_STATE_ENTER_VEHICLE_DRIVER or PLAYER_STATE_ENTER_VEHICLE_PASSENGER or PLAYER_STATE_EXIT_VEHICLE this is? what is it used? I do not understand an example please thanks in advance


Re: PLAYER_STATE_ENTER_VEHICLE_DRIVER - scottyishere - 27.12.2010

pawn Код:
if(GetPlayerState(playerid) == PLAYER_STATE_ENTER_VEHICLE_DRIVER)
{
    print("Player enters vehicle as driver");
}
//alternatively you can use
OnPlayerEnterVehicle(playerid,vehicleid,ispassenger)
//and
OnPlayerExitVehicle(playerid,vehicleid,ispassenger)



Re: PLAYER_STATE_ENTER_VEHICLE_DRIVER - Grah - 27.12.2010

this can be used to prevent driveby'ing, if you want to remove that feature, it can also be used for a wide variety of other uses, like checking to see if a person is a driver of a vehicle to make him able to do certain commands, etc.
ex:
you want only the driver of a vehicle to be able to /refuel, so you use this function under your /refuel command and make it return true, then make the passenger return false
^^there are other ways of doing this w/o using this function but this is just a way that you CAN use it.