Squirrel/Server/Functions/Blips/Owner

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Example)
Line 12: Line 12:
 
== Example ==
 
== Example ==
  
{{Squirrel/NeedsExample}}
 
 
<code lang="squirrel">
 
<code lang="squirrel">
-- todo
+
function onPlayerCommand( pPlayer, szCommand, szText )
 +
{
 +
else if ( szCommand == "owner" )
 +
{
 +
local pBlip = FindBlip( 0 );
 +
if ( pBlip ) MessagePlayer( "Blip ID 0 has no owner", pPlayer );
 +
else
 +
{
 +
pBlip = FindBlip( 0, pPlayer );
 +
if ( pBlip ) MessagePlayer( "Blip ID 0's owner is - " + pBlip.Owner, pPlayer );
 +
}
 +
}
 +
}
 
</code>
 
</code>
  
 
=== Notes ===
 
=== Notes ===
  
Example notes and used functions here.
+
The function [[Squirrel/Server/Functions/Messages/MessagePlayer|MessagePlayer]] and event [[Squirrel/Server/Events/Player/onPlayerCommand|onPlayerCommand]] were used in in this example. More info about them in the corresponding pages.
  
 
== Related Functions ==
 
== Related Functions ==
  
 
{{Squirrel/Server/Functions/Blips}}
 
{{Squirrel/Server/Functions/Blips}}

Revision as of 19:25, 28 September 2010

Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This Blip class member returns a pointer to the owner of this blip, or null if the blip is visible for everyone.

Syntax

  1. Player Blip.Owner

Arguments

  • none

Example

  1.  
  2. function onPlayerCommand( pPlayer, szCommand, szText )
  3. {
  4. else if ( szCommand == "owner" )
  5. {
  6. local pBlip = FindBlip( 0 );
  7. if ( pBlip ) MessagePlayer( "Blip ID 0 has no owner", pPlayer );
  8. else
  9. {
  10. pBlip = FindBlip( 0, pPlayer );
  11. if ( pBlip ) MessagePlayer( "Blip ID 0's owner is - " + pBlip.Owner, pPlayer );
  12. }
  13. }
  14. }
  15.  

Notes

The function MessagePlayer and event onPlayerCommand were used in in this example. More info about them in the corresponding pages.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox