Squirrel/Server/Functions/Blips/Owner
From Liberty Unleashed Wiki
(Difference between revisions)
(→Example) |
(→Example) |
||
Line 15: | Line 15: | ||
function onPlayerCommand( pPlayer, szCommand, szText ) | function onPlayerCommand( pPlayer, szCommand, szText ) | ||
{ | { | ||
− | + | if ( szCommand == "owner" ) | |
{ | { | ||
local pBlip = FindBlip( 0 ); | local pBlip = FindBlip( 0 ); |
Revision as of 19:30, 28 September 2010
This Blip class member returns a pointer to the owner of this blip, or null if the blip is visible for everyone.
Syntax
Player Blip.Owner
Arguments
- none
Example
function onPlayerCommand( pPlayer, szCommand, szText ) { 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 ); } } }
Notes
The function MessagePlayer and event onPlayerCommand were used in in this example. More info about them in the corresponding pages.