Object::Object: Difference between revisions
No edit summary |
Almeidowski (talk | contribs) No edit summary |
||
| Line 23: | Line 23: | ||
*'''position''': {{RageType|Vector3}} | *'''position''': {{RageType|Vector3}} | ||
*'''rotation''': {{RageType|Vector3}} | *'''rotation''': {{RageType|Vector3}} | ||
*'''alpha''': {{RageType|Number}} | *'''alpha''': {{RageType|Number}}: The object's transparency. | ||
*'''dimension''': {{RageType|Number}} | *'''dimension''': {{RageType|Number}} | ||
| Line 29: | Line 29: | ||
<pre> | <pre> | ||
// | mp.events.addCommand('flag', (player) => { | ||
mp.objects.new('apa_prop_flag_portugal, player.position, | |||
{ | |||
rotation: player.rotation, | |||
alpha: 100, | |||
dimension: player.dimension | |||
}); | |||
}); | |||
//Following this code, you'll create a portuguese flag (apa_prop_flag_portugal) at the players position, facing the same way the player is facing, with no transparency (100 on alphaa) and at the same dimension the player is. | |||
</pre> | </pre> | ||
}} | }} | ||
Revision as of 12:13, 30 August 2020
Creates a new Object.
JavaScript Syntax
Syntax
Shared
mp.objects.new(model, position,
{
rotation: rotation,
alpha: alpha,
dimension: dimension
});
Required Arguments
- model: Hash
- position: Vector3
- rotation: Vector3
- alpha: Number: The object's transparency.
- dimension: Number
Example
mp.events.addCommand('flag', (player) => {
mp.objects.new('apa_prop_flag_portugal, player.position,
{
rotation: player.rotation,
alpha: 100,
dimension: player.dimension
});
});
//Following this code, you'll create a portuguese flag (apa_prop_flag_portugal) at the players position, facing the same way the player is facing, with no transparency (100 on alphaa) and at the same dimension the player is.