Entity::isAttached: Difference between revisions

From RAGE Multiplayer Wiki
(yay)
 
 
(One intermediate revision by one other user not shown)
Line 2: Line 2:
==Syntax==
==Syntax==
<syntaxhighlight lang="javascript">entity.isAttached();</syntaxhighlight>
<syntaxhighlight lang="javascript">entity.isAttached();</syntaxhighlight>
It appears that, once you are driving a vehicle... you are attached to it.
=== Required Arguments ===
=== Required Arguments ===
===Return value===
=== Return value ===
*'''Boolean'''
*'''Boolean'''
==Example==
==Example==
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
// todo
mp.keys.bind(0x32, false, () => { // '2'
mp.game.graphics.notify(`~r~${player.isAttached()}.`);
if(player.isAttached()) {
// player is attached to something
}
});
</syntaxhighlight>
</syntaxhighlight>
==See also==
==See also==
{{Entity_function_c}}
{{Entity_definition_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:TODO: Example]]
[[Category:TODO: Example]]

Latest revision as of 18:02, 1 May 2024

Syntax

entity.isAttached();

It appears that, once you are driving a vehicle... you are attached to it.

Required Arguments

Return value

  • Boolean

Example

mp.keys.bind(0x32, false, () => { // '2'
	mp.game.graphics.notify(`~r~${player.isAttached()}.`);
	if(player.isAttached()) {
		// player is attached to something
	}
});

See also