<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.vc-mp.org/index.php?action=history&amp;feed=atom&amp;title=Scripting%2FSquirrel%2FFunctions%2FVehicle.Driver</id>
	<title>Scripting/Squirrel/Functions/Vehicle.Driver - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.vc-mp.org/index.php?action=history&amp;feed=atom&amp;title=Scripting%2FSquirrel%2FFunctions%2FVehicle.Driver"/>
	<link rel="alternate" type="text/html" href="http://wiki.vc-mp.org/index.php?title=Scripting/Squirrel/Functions/Vehicle.Driver&amp;action=history"/>
	<updated>2026-04-10T06:42:04Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>http://wiki.vc-mp.org/index.php?title=Scripting/Squirrel/Functions/Vehicle.Driver&amp;diff=20112&amp;oldid=prev</id>
		<title>Umar4911: Created page with &quot;This function will tell the name of the car driver.  == Syntax ==  &lt;pre&gt;Vehicle.Driver()&lt;/pre&gt;  == Example ==  &lt;source lang=&quot;squirrel&quot;&gt; function onPlayerCommand( player, cmd,...&quot;</title>
		<link rel="alternate" type="text/html" href="http://wiki.vc-mp.org/index.php?title=Scripting/Squirrel/Functions/Vehicle.Driver&amp;diff=20112&amp;oldid=prev"/>
		<updated>2017-11-24T09:36:42Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;This function will tell the name of the car driver.  == Syntax ==  &amp;lt;pre&amp;gt;Vehicle.Driver()&amp;lt;/pre&amp;gt;  == Example ==  &amp;lt;source lang=&amp;quot;squirrel&amp;quot;&amp;gt; function onPlayerCommand( player, cmd,...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This function will tell the name of the car driver.&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Vehicle.Driver()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;squirrel&amp;quot;&amp;gt;&lt;br /&gt;
function onPlayerCommand( player, cmd, text )&lt;br /&gt;
{&lt;br /&gt;
	if(cmd == &amp;quot;driver&amp;quot;)&lt;br /&gt;
	{&lt;br /&gt;
		if(!text) MessagePlayer(&amp;quot;Syntax Error - Syntax: /driver &amp;lt;vehicle ID&amp;gt;&amp;quot;, player);&lt;br /&gt;
		else if(!IsNum(text)) MessagePlayer(&amp;quot;Error - ID must be integer&amp;quot;, player);&lt;br /&gt;
		else&lt;br /&gt;
		{&lt;br /&gt;
			local veh = FindVehicle(text.tointeger());&lt;br /&gt;
			if(!veh) MessagePlayer(&amp;quot;Unknown Vehicle&amp;quot;, player);&lt;br /&gt;
			else if(!veh.Driver) MessagePlayer(&amp;quot;There is no driver in the vehicle&amp;quot;, player);&lt;br /&gt;
			else if(veh.Driver == player.Name) MessagePlayer(&amp;quot;You are the driver&amp;quot;, player);&lt;br /&gt;
			else&lt;br /&gt;
			{&lt;br /&gt;
				MessagePlayer(veh.Driver + &amp;quot; is driving the vehicle&amp;quot;, player);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Notes ===&lt;br /&gt;
Call [[Scripting/Squirrel/Events/Player/onPlayerCommand|onPlayerCommand]] were used in this example. More info about them in the corresponding pages.&lt;br /&gt;
&lt;br /&gt;
== Related Functions ==&lt;br /&gt;
{{Scripting/Squirrel/Functions/Vehicle_Functions}}&lt;br /&gt;
[[Category:Scripting/Squirrel/Functions/Vehicle_Functions]]&lt;/div&gt;</summary>
		<author><name>Umar4911</name></author>
	</entry>
</feed>