Squirrel/Server/Functions/Blips/Owner
From Liberty Unleashed Wiki
(Difference between revisions)
(→Example) |
|||
Line 11: | Line 11: | ||
== Example == | == Example == | ||
+ | |||
+ | This example function will return the name of the blip owner (or "Unknown" if the blip is a global blip) when called. | ||
<code lang="squirrel"> | <code lang="squirrel"> | ||
− | function | + | // This is a custom function |
+ | function GetBlipOwnerName( blip ) | ||
{ | { | ||
− | + | if ( blip.Owner ) return blip.Owner.Name; | |
− | + | return "Unknown"; | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
} | } | ||
</code> | </code> | ||
Line 30: | Line 25: | ||
=== Notes === | === Notes === | ||
− | The function [[Squirrel/Server/Functions/ | + | The function [[Squirrel/Server/Functions/Players/Name|Player.Name]] was used in in this example. More info about it in the corresponding page. |
+ | |||
+ | Note that this function is a completely custom function, you'll have to call it using your own script. | ||
== Related Functions == | == Related Functions == | ||
{{Squirrel/Server/Functions/Blips}} | {{Squirrel/Server/Functions/Blips}} |
Latest revision as of 00:22, 29 September 2010
This Blip class member returns a pointer to the owner of this blip, or null if the blip is visible for everyone.
[edit] Syntax
Player Blip.Owner
[edit] Arguments
- none
[edit] Example
This example function will return the name of the blip owner (or "Unknown" if the blip is a global blip) when called.
// This is a custom function function GetBlipOwnerName( blip ) { if ( blip.Owner ) return blip.Owner.Name; return "Unknown"; }
[edit] Notes
The function Player.Name was used in in this example. More info about it in the corresponding page.
Note that this function is a completely custom function, you'll have to call it using your own script.