SetBlipColor: Difference between revisions

From RAGE Multiplayer Wiki
Line 9: Line 9:


==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]]

Revision as of 15:25, 26 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);