IsPlayerHitByVehicle: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "'''isPlayerHitByVehicle''' ==Syntax== <syntaxhighlight lang="lua"> bool isPlayerHitByVehicle(attacker) </syntaxhighlight> ===Required Arguments=== * '''attacker''' : The pla...")
 
 
(16 intermediate revisions by the same user not shown)
Line 7: Line 7:


===Required Arguments===
===Required Arguments===
* '''attacker''' : The player you want to another player .
* '''attacker''' : The element that attacks .


== Shared ==
==Function Source==
 
----
 
 
This function cancels event when a player is hit by a vehicle.
 
==Code==
<section name="Function source" class="both" show="true">
<section name="Function source" class="both" show="true">
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
Line 29: Line 22:
</syntaxhighlight>
</syntaxhighlight>
</section>
</section>


== Author ==
== Author ==


Lisek)
Lisek
In Discord Lisek#5811

Latest revision as of 08:21, 10 June 2020

isPlayerHitByVehicle

Syntax

bool isPlayerHitByVehicle(attacker)

Required Arguments

  • attacker : The element that attacks .

Function Source

Click to collapse [-]
Function source
function isPlayerHitByVehicle (attacker)
	if not attacker then
		return
	end
	if getElementType(attacker) == 'vehicle' then
		cancelEvent()
	end
end

Author

Lisek In Discord Lisek#5811