Difference between revisions of "Object::Object"

From RAGE Multiplayer Wiki
Jump to navigation Jump to search
m (Cat)
 
(2 intermediate revisions by the same user not shown)
Line 4: Line 4:
 
   
 
   
 
*'''[https://cdn.rage.mp/public/odb/index.html Objects gallery]'''
 
*'''[https://cdn.rage.mp/public/odb/index.html Objects gallery]'''
==Parameters==
 
*'''model''': {{RageType|Hash}} (use [[Globals::joaat|mp.joaat]])
 
*'''position''': {{RageType|Vector3}}
 
*'''rotation''': {{RageType|Vector3}}
 
*'''alpha''': {{RageType|Number}}
 
*'''dimension''': {{RageType|Number}}
 
  
 +
 +
{{JSContainer|
 
==Syntax==
 
==Syntax==
 
+
{{SharedCode|
<syntaxhighlight lang="javascript">
+
<pre>
 
mp.objects.new(model, position,
 
mp.objects.new(model, position,
 
{
 
{
Line 20: Line 16:
 
     dimension: dimension
 
     dimension: dimension
 
});
 
});
</syntaxhighlight>
+
</pre>
 +
}}
 +
 
 +
==Required Arguments==
 +
*'''model''': {{RageType|Hash}}
 +
*'''position''': {{RageType|Vector3}}
 +
*'''rotation''': {{RageType|Vector3}}
 +
*'''alpha''': {{RageType|Number}}
 +
*'''dimension''': {{RageType|Number}}
  
=Example=
+
==Example==
  
<syntaxhighlight lang="javascript">
+
<pre>
 
// TODO
 
// TODO
</syntaxhighlight>
+
</pre>
 
+
}}
 
[[Category:Object API]]
 
[[Category:Object API]]
 
[[Category:Shared Function]]
 
[[Category:Shared Function]]
 
[[Category:TODO: Example]]
 
[[Category:TODO: Example]]

Latest revision as of 11:45, 3 December 2019

Js.png JavaScript


Creates a new Object.


JavaScript Syntax
Jslogo.png

Syntax

Shared
mp.objects.new(model, position,
{
    rotation: rotation,
    alpha: alpha,
    dimension: dimension
});

Required Arguments

  • model: Hash
  • position: Vector3
  • rotation: Vector3
  • alpha: Number
  • dimension: Number

Example

// TODO