Vehicle::getMod: Difference between revisions

From RAGE Multiplayer Wiki
mNo edit summary
Line 8: Line 8:
==Example==
==Example==
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
// todo
const player = mp.players.local;
 
if (player.vehicle) {
    mp.gui.chat.push(player.vehicle.getMod(1).toString());
}
 
else mp.gui.chat.push("You need a car!");
</syntaxhighlight>
</syntaxhighlight>
==See also==
==See also==
{{Vehicle_function_c}}
{{Vehicle_function_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:TODO: Example]]
[[Category:TODO: Example]]

Revision as of 23:12, 26 April 2020

In b944, there are 50 (0 - 49) mod types.

Returns 255 if the vehicle mod is stock

Syntax

vehicle.getMod(modType);

Required Arguments

  • modType: int

Return value

  • int

Example

const player = mp.players.local;

if (player.vehicle) {
    mp.gui.chat.push(player.vehicle.getMod(1).toString());
}

else mp.gui.chat.push("You need a car!");

See also