SetBlipColor: Difference between revisions

From RAGE Multiplayer Wiki
(Created page with "Sets the color of a blip. ==Syntax== <pre>void NAPI.Blip.SetBlipColor(Blip blip, int color);</pre> === Required Arguments === *'''blip:''' The blip to get the color from. Pa...")
 
m (Xabi moved page NAPI.Blip.SetBlipColor to SetBlipColor)
 
(4 intermediate revisions by one other user not shown)
Line 5: Line 5:


=== Required Arguments ===
=== Required Arguments ===
*'''blip:''' The blip to get the color from. Parameter input should be in '''Blip''' type
*'''blip:''' The blip to set the color. Parameter input should be in '''Blip''' type
*'''name:''' The name to use on that blip. This parameter input should be in '''string''' type
*'''color:''' The color to set. Parameter input should be in '''int''' type (https://wiki.rage.mp/index.php?title=Blip::color)


==Example==
==Example==
Sets names based on ID to any existing blip without a name.
Sets any existing white blip to blue blip.
{{CSharpContainer|
{{CSharpContainer|
{{Example}}
{{Example}}
<syntaxhighlight lang="C#">
<syntaxhighlight lang="C#">
var blips = NAPI.Pools.GetAllBlips();
var list = NAPI.Pools.GetAllBlips();
for (int i = 0; i < blips.Count; i++)
foreach (var blip in list)
     if (string.IsNullOrEmpty(NAPI.Blip.GetBlipName(b)))
     if (NAPI.Blip.GetBlipColor(blip) == 0)
         NAPI.Blip.SetBlipName(b, "Blip No." + i);
         NAPI.Blip.SetBlipColor(blip, 38);
</syntaxhighlight>
</syntaxhighlight>
}}
}}


[[Category:Serverside API]]
[[Category:Serverside API]]

Latest revision as of 12:42, 27 November 2019

Sets the color of a blip.

Syntax

void NAPI.Blip.SetBlipColor(Blip blip, int color);

Required Arguments

Example

Sets any existing white blip to blue blip.

C# Syntax

Example

var list = NAPI.Pools.GetAllBlips();
foreach (var blip in list)
    if (NAPI.Blip.GetBlipColor(blip) == 0)
        NAPI.Blip.SetBlipColor(blip, 38);