Vehicle::getClass: Difference between revisions

From RAGE Multiplayer Wiki
(yay)
 
No edit summary
Line 1: Line 1:
Returns an int<br><br>Vehicle Classes:<br>0: Compacts<br>1: Sedans<br>2: SUVs<br>3: Coupes<br>4: Muscle<br>5: Sports Classics<br>6: Sports<br>7: Super<br>8: Motorcycles<br>9: Off-road<br>10: Industrial<br>11: Utility<br>12: Vans<br>13: Cycles<br>14: Boats<br>15: Helicopters<br>16: Planes<br>17: Service<br>18: Emergency<br>19: Military<br>20: Commercial<br>21: Trains<br><br>char buffer[128];<br>std::sprintf(buffer, 'VEH_CLASS_%i', VEHICLE::GET_VEHICLE_CLASS(vehicle));<br><br>char* className = UI::_GET_LABEL_TEXT(buffer);
Gets the Vehicle Class.
 
<br><br>Vehicle Classes:<br>0: Compacts<br>1: Sedans<br>2: SUVs<br>3: Coupes<br>4: Muscle<br>5: Sports Classics<br>6: Sports<br>7: Super<br>8: Motorcycles<br>9: Off-road<br>10: Industrial<br>11: Utility<br>12: Vans<br>13: Cycles<br>14: Boats<br>15: Helicopters<br>16: Planes<br>17: Service<br>18: Emergency<br>19: Military<br>20: Commercial<br>21: Trains<br>
 
==Syntax==
==Syntax==
<syntaxhighlight lang="javascript">vehicle.getClass();</syntaxhighlight>
<syntaxhighlight lang="javascript">vehicle.getClass();</syntaxhighlight>
=== Required Arguments ===
 
===Return value===
===Return value===
*'''int'''
*'''int'''
==Example==
==Example==
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
// todo
let vehicle = mp.players.local.vehicle;
let vehClass = vehicle.getClass(); // Defining a variable with the return value of vehicle.getClass()
</syntaxhighlight>
</syntaxhighlight>
==See also==
==See also==
{{Vehicle_function_c}}
{{Vehicle_function_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:TODO: Example]]

Revision as of 23:44, 6 December 2017

Gets the Vehicle Class.



Vehicle Classes:
0: Compacts
1: Sedans
2: SUVs
3: Coupes
4: Muscle
5: Sports Classics
6: Sports
7: Super
8: Motorcycles
9: Off-road
10: Industrial
11: Utility
12: Vans
13: Cycles
14: Boats
15: Helicopters
16: Planes
17: Service
18: Emergency
19: Military
20: Commercial
21: Trains

Syntax

vehicle.getClass();

Return value

  • int

Example

let vehicle = mp.players.local.vehicle;
let vehClass = vehicle.getClass(); // Defining a variable with the return value of vehicle.getClass()

See also