Blip::Blip: Difference between revisions

From RAGE Multiplayer Wiki
m (Changed layout, made example simpler.)
Line 1: Line 1:
__NOTOC__
{{Shared}}
'''Function''': Creates a blip.
 
==Parameters==
Creates a blip to display on your map & minimap.
*'''sprite''': {{RageType|Int}} ([[Blips#Blip_model|Blip sprites]])
*'''position''': {{RageType|Vector3}}
*'''name''': {{RageType|String}}
*'''scale''': {{RageType|Float}}
*'''color''': {{RageType|Color ID}} ([[Blips#Blip_colors|Blip colors]])
*'''alpha''': {{RageType|Int}} [0:255]
*'''drawDistance''': {{RageType|Float}}
*'''shortRange''': {{RageType|Boolean}}: Auto-hide on the minimap
*'''rotation''': {{RageType|Vector3}}
*'''dimension''': {{RageType|Int}}


Note: only '''sprite''' and '''position''' are required to make a Blip.
== Syntax ==


==Syntax==
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
mp.blips.new(sprite, position,
mp.blips.new(sprite, position,
Line 28: Line 17:
     dimension: dimension,
     dimension: dimension,
});
});
</syntaxhighlight>  
</syntaxhighlight>
 
=== Parameters ===
*'''<span style="font-weight:bold; color:red;">*</span>sprite''': {{RageType|Int}} ([[Blips#Blip_model|Blip sprites]])
*'''<span style="font-weight:bold; color:red;">*</span>position''': {{RageType|Vector3}}
*'''name''': {{RageType|String}}
*'''scale''': {{RageType|Float}}
*'''color''': {{RageType|Color ID}} ([[Blips#Blip_colors|Blip colors]])
*'''alpha''': {{RageType|Int}} [0:255]
*'''drawDistance''': {{RageType|Float}}
*'''shortRange''': {{RageType|Boolean}}: Auto-hide on the minimap
*'''rotation''': {{RageType|Vector3}}
*'''dimension''': {{RageType|Int}}
 
 
<span style="font-weight:bold; color:red;">*</span> = Required
 
== Examples ==
 
This creates a blip at the police station. The blip is assigned to the variable '''policeBlip'''.


==Example==
{{Shared}}
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
let policeBlipVector = new mp.Vector3(408.4915466308594, -979.883056640625, 29.22386360168457); //Set a Vector3
let policeBlip = mp.blips.new(60, new mp.Vector3(427.95, -981.05, 0),
let userBlip = mp.blips.new(8, policeBlipVector, {
    {
         name: "Policestation",
         name: 'Los Santos Police Station',
        scale: 2,
         color: 3,
         color: 7,
        alpha: 255,
        drawDistance: 100,
         shortRange: true,
         shortRange: true,
        rotation: 0,
});
        dimension: 0,
    }); //Create a Blip on a Policestation
</syntaxhighlight>
</syntaxhighlight>
This example creates a Blip at a Policestation.


==See Also==
== See Also ==
{{Blip_definition}}
{{Blip_definition}}

Revision as of 10:09, 11 May 2018

Shared

Creates a blip to display on your map & minimap.

Syntax

mp.blips.new(sprite, position,
{
    name: name,
    scale: scale,
    color: color,
    alpha: alpha,
    drawDistance: drawDistance,
    shortRange: shortRange,
    rotation: rotation,
    dimension: dimension,
});

Parameters

  • *sprite: Int (Blip sprites)
  • *position: Vector3
  • name: String
  • scale: Float
  • color: Color ID (Blip colors)
  • alpha: Int [0:255]
  • drawDistance: Float
  • shortRange: Boolean: Auto-hide on the minimap
  • rotation: Vector3
  • dimension: Int


* = Required

Examples

This creates a blip at the police station. The blip is assigned to the variable policeBlip.

let policeBlip = mp.blips.new(60, new mp.Vector3(427.95, -981.05, 0),
    {
        name: 'Los Santos Police Station',
        color: 3,
        shortRange: true,
});

See Also