Vehicle::getNumberPlateTextIndex: Difference between revisions

From RAGE Multiplayer Wiki
(yay)
 
No edit summary
 
Line 1: Line 1:
Returns the PlateType of a vehicle<br> Blue_on_White_1 = 3,<br> Blue_on_White_2 = 0,<br> Blue_on_White_3 = 4,<br> Yellow_on_Blue = 2,<br> Yellow_on_Black = 1,<br> North_Yankton = 5,
{{ClientsideJsFunction}}
{{JSContainer|
 
Returns the PlateType of a vehicle<br>
<pre>
0 - Blue on White1
1 - Yellow on Black
2 - Yellow on Blue
3 - Blue on White2
4 - Blue on White "SA EXEMPT"
5 - North Yankton
6 - eCola
7 - Las Venturas
8 - Liberty City
9 - LS Car Meet
10 - LS Panic
11 - LS Pounders
12 - Sprunk
</pre>
 
==Syntax==
==Syntax==
<syntaxhighlight lang="javascript">vehicle.getNumberPlateTextIndex();</syntaxhighlight>
<syntaxhighlight lang="javascript">vehicle.getNumberPlateTextIndex();</syntaxhighlight>
=== Required Arguments ===
 
===Return value===
===Return value===
*'''int'''
*''' {{RageType|number}} '''
==Example==
==Example==
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
// todo
const vehicle = mp.vehicles.at(0); //find vehicle with 'id' 0
if (!vehicle || !mp.vehicles.exists(vehicle)) return;
const plateType = vehicle.getNumberPlateTextIndex();
mp.console.logInfo(`Vehicle ID ${vehicle.id} has plate type number ${plateType}`);
</syntaxhighlight>
</syntaxhighlight>
}}
==See also==
==See also==
{{Vehicle_function_c}}
{{Vehicle_function_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:TODO: Example]]

Latest revision as of 17:48, 28 May 2024

Client-Side
Function

 JavaScript



JavaScript Syntax


Returns the PlateType of a vehicle

0 - Blue on White1
1 - Yellow on Black
2 - Yellow on Blue
3 - Blue on White2
4 - Blue on White "SA EXEMPT"
5 - North Yankton
6 - eCola
7 - Las Venturas
8 - Liberty City
9 - LS Car Meet
10 - LS Panic
11 - LS Pounders
12 - Sprunk

Syntax

vehicle.getNumberPlateTextIndex();

Return value

  • number

Example

const vehicle = mp.vehicles.at(0); //find vehicle with 'id' 0
if (!vehicle || !mp.vehicles.exists(vehicle)) return;
const plateType = vehicle.getNumberPlateTextIndex();
mp.console.logInfo(`Vehicle ID ${vehicle.id} has plate type number ${plateType}`);


See also