Squirrel/Server/Functions/Blips/ID

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Example)
 
Line 11: Line 11:
  
 
== Example ==
 
== Example ==
 +
 +
THis example command creates a new radar blip and prints its ID for the player.
  
 
<code lang="squirrel">
 
<code lang="squirrel">
 
function onPlayerCommand( pPlayer, szCommand, szText )
 
function onPlayerCommand( pPlayer, szCommand, szText )
 
{
 
{
if ( szCommand == "createblip" )
+
    if ( szCommand == "createblip" )
{
+
    {
local pBlip = CreateBlip( 0, pPlayer.Pos, 0 );
+
          local pBlip = CreateBlip( BLIP_8BALL, pPlayer.Pos, 0 );
if ( pBlip ) MessagePlayer( "Created Blip ID " + pBlip.ID, pPlayer );
+
          if ( pBlip ) MessagePlayer( "Created Blip ID " + pBlip.ID, pPlayer );
}
+
    }
 +
   
 +
    return 1;
 
}
 
}
 
</code>
 
</code>
Line 25: Line 29:
 
=== Notes ===
 
=== Notes ===
  
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.
+
The functions [[Squirrel/Server/Functions/Messages/MessagePlayer|MessagePlayer]], [[Squirrel/Server/Functions/Players/Pos|Player.Pos]] 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}}

Latest revision as of 23:54, 28 September 2010

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

This Blip class member returns the ID of the blip.

[edit] Syntax

  1. int Blip.ID

[edit] Arguments

  • none

[edit] Example

THis example command creates a new radar blip and prints its ID for the player.

  1.  
  2. function onPlayerCommand( pPlayer, szCommand, szText )
  3. {
  4. if ( szCommand == "createblip" )
  5. {
  6. local pBlip = CreateBlip( BLIP_8BALL, pPlayer.Pos, 0 );
  7. if ( pBlip ) MessagePlayer( "Created Blip ID " + pBlip.ID, pPlayer );
  8. }
  9. return 1;
  10. }
  11.  

[edit] Notes

The functions MessagePlayer, Player.Pos and event onPlayerCommand were used in in this example. More info about them in the corresponding pages.

[edit] Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox