Blip::Blip: Difference between revisions

From RAGE Multiplayer Wiki
m (Fancy border added for example)
mNo edit summary
 
(11 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{Shared}}
{{SharedFunctionJS}}


Creates a blip to display on your map & minimap.
Creates a blip to display on your map & minimap.
Blips created server-side seem to be impossible to attach to the map. If you create the same blip server-side and client-side, only the second will stay attached to the map (the scale won't change if you zoom in or out).


For client-side usage, be sure that the handle is loaded (blip.handle > 0) before editing blip by any of RAGE functions / natives.
{{JSContainer|
== Syntax ==
== Syntax ==


Line 16: Line 20:
     rotation: rotation,
     rotation: rotation,
     dimension: dimension,
     dimension: dimension,
    radius: radius,
});
});
</pre>
</pre>


=== Parameters ===
=== Parameters ===
*'''<span style="font-weight:bold; color:red;">*</span>sprite''': {{RageType|Int}} ([[Blips#Blip_model|Blip sprites]])
*'''{{Required}}sprite''': {{RageType|Int}} ([[Blips#Blip_model|Blip sprites]])
*'''<span style="font-weight:bold; color:red;">*</span>position''': {{RageType|Vector3}}
*'''{{Required}}position''': {{RageType|Vector3}}
*'''name''': {{RageType|String}}
*'''name''': {{RageType|String}}
*'''scale''': {{RageType|Float}}
*'''scale''': {{RageType|Float}}: How big the blip shows on the map
*'''color''': {{RageType|Color ID}} ([[Blips#Blip_colors|Blip colors]])
*'''color''': {{RageType|Color ID}} ([[Blips#Blip_colors|Blip colors]])
*'''alpha''': {{RageType|Int}} [0:255]
*'''alpha''': {{RageType|Int}} [0:255]
*'''drawDistance''': {{RageType|Float}}
*'''drawDistance''': {{RageType|Float}}
*'''shortRange''': {{RageType|Boolean}}: Auto-hide on the minimap
*'''shortRange''': {{RageType|Boolean}}: If it's hidden in the minimap until the player is close
*'''rotation''': {{RageType|Float}}
*'''rotation''': {{RageType|Float}}
*'''dimension''': {{RageType|Int}}
*'''dimension''': {{RageType|Int}}
*'''radius''': {{RageType|Float}}


 
== Example ==
<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'''.
This creates a blip at the police station. The blip is assigned to the variable '''policeBlip'''.


<div class="header" style="background-color: #00baad; color: #FFFFFF; border: 2px solid #00baad;">
{{SharedCode|
<div style="margin: 10px 10px 10px 10px;"><b>Shared</b></div>
<pre>
<pre>
let policeBlip = mp.blips.new(60, new mp.Vector3(427.95, -981.05, 0),
let policeBlip = mp.blips.new(60, new mp.Vector3(427.95, -981.05, 0),
Line 48: Line 50:
});
});
</pre>
</pre>
</div>
}}
}}


== See Also ==
== See Also ==
{{Blip_definition}}
{{Blip_definition}}
[[Category:Blip API]]
[[Category:Shared Function]]

Latest revision as of 09:51, 21 February 2022

Shared
Function

 JavaScript


Creates a blip to display on your map & minimap. Blips created server-side seem to be impossible to attach to the map. If you create the same blip server-side and client-side, only the second will stay attached to the map (the scale won't change if you zoom in or out).

For client-side usage, be sure that the handle is loaded (blip.handle > 0) before editing blip by any of RAGE functions / natives.

JavaScript Syntax

Syntax

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

Parameters

  • *sprite: Int (Blip sprites)
  • *position: Vector3
  • name: String
  • scale: Float: How big the blip shows on the map
  • color: Color ID (Blip colors)
  • alpha: Int [0:255]
  • drawDistance: Float
  • shortRange: Boolean: If it's hidden in the minimap until the player is close
  • rotation: Float
  • dimension: Int
  • radius: Float

Example

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

Shared
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