Scripting/Server/Functions/SetPassengerKey

(v0.3.1-r5+) The run-time versions of the server.conf options passenger_key and traffic_passenger. SetPassengerKey(false) disables the enter-as-passenger shortcut (G on PC, pad hold, RIDE button on Android). SetTrafficPassenger(false) stops players from riding along with an AI driver (traffic car, server NPC). Both are sent to every player at once and to players who join later.

Syntax

SetPassengerKey(bool)
SetTrafficPassenger(bool)
GetPassengerKey()
GetTrafficPassenger()

Arguments

Example

function onPlayerCommand( player, cmd, params )
{
	if ( cmd == "setpassengerkey" )
	{
		SetPassengerKey( true );
	}
}

This sample was generated from the signature – adapt the values to your gamemode.

Section: World settings

Categories: Server functions | World settings