Squirrel/Server/Functions/Blips/Owner
From Liberty Unleashed Wiki
(Difference between revisions)
m (moved Squirrel/Functions/Blips/Owner to Squirrel/Server/Functions/Blips/Owner: Server-side function) |
|||
(2 intermediate revisions by one user not shown) | |||
Line 12: | Line 12: | ||
== 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"> | ||
− | + | // This is a custom function | |
+ | function GetBlipOwnerName( blip ) | ||
+ | { | ||
+ | if ( blip.Owner ) return blip.Owner.Name; | ||
+ | return "Unknown"; | ||
+ | } | ||
</code> | </code> | ||
=== Notes === | === Notes === | ||
− | + | 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.