Squirrel/Server/Functions/Players/Marker

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
m
 
Line 13: Line 13:
 
== Example 1. Returning ==
 
== Example 1. Returning ==
  
{{Squirrel/NeedsExample}}
+
This will tell the player if their marker is being shown or not when they type '/marker'.
Explanation for the example
+
  
 
<code lang="squirrel">
 
<code lang="squirrel">
-- todo
+
function onPlayerCommand( pPlayer, szCommand, szText )
 +
{
 +
if ( szCommand == "marker" )
 +
{
 +
MessagePlayer( "Marker being shown - " + pPlayer.Marker, pPlayer );
 +
}
 +
 +
return 1;
 +
}
 
</code>
 
</code>
  
 
== Example 2. Setting ==
 
== Example 2. Setting ==
  
{{Squirrel/NeedsExample}}
+
This will hide the player's marker when they type '/marker2'.
Explanation for the example
+
  
 
<code lang="squirrel">
 
<code lang="squirrel">
-- todo
+
function onPlayerCommand( pPlayer, szCommand, szText )
 +
{
 +
if ( szCommand == "marker2" )
 +
{
 +
pPlayer.Marker = false;
 +
}
 +
 +
return 1;
 +
}
 
</code>
 
</code>
  
 
=== Notes ===
 
=== Notes ===
  
-- List of used functions and other notes here.
+
The function [[Squirrel/Server/Functions/Messages/MessagePlayer|MessagePlayer]] and event [[Squirrel/Server/Events/Player/onPlayerCommand|onPlayerCommand]] were used in these examples. More info about them in the corresponding pages.
  
 
== Related Functions ==
 
== Related Functions ==
  
 
{{Squirrel/Server/Functions/Players}}
 
{{Squirrel/Server/Functions/Players}}

Latest revision as of 16:00, 25 October 2010

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

This function sets/returns the players radar marker.

[edit] Syntax

  1. bool player.Marker
  1. player.Marker = bool value

[edit] Arguments

  • value - A boolean saying if the radar marker is enabled/disabled.

[edit] Example 1. Returning

This will tell the player if their marker is being shown or not when they type '/marker'.

  1.  
  2. function onPlayerCommand( pPlayer, szCommand, szText )
  3. {
  4. if ( szCommand == "marker" )
  5. {
  6. MessagePlayer( "Marker being shown - " + pPlayer.Marker, pPlayer );
  7. }
  8. return 1;
  9. }
  10.  

[edit] Example 2. Setting

This will hide the player's marker when they type '/marker2'.

  1.  
  2. function onPlayerCommand( pPlayer, szCommand, szText )
  3. {
  4. if ( szCommand == "marker2" )
  5. {
  6. pPlayer.Marker = false;
  7. }
  8. return 1;
  9. }
  10.  

[edit] Notes

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

[edit] Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox