Squirrel/Server/Functions/Game/GetMinute

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Updated with the latest functions)
Line 15: Line 15:
  
 
<code lang="squirrel">
 
<code lang="squirrel">
function OnPlayerCommand( id, cmd, text )
+
function onPlayerCommand( plr, cmd, text )
 
{
 
{
 
     if ( cmd == "time" )
 
     if ( cmd == "time" )
 
     {
 
     {
           MessagePlayer( "Server time is: " + GetHour() + ":" + GetMinute(), id );
+
           MessagePlayer( "Server time is: " + GetHour() + ":" + GetMinute(), plr );
 
     }
 
     }
 
}
 
}
Line 26: Line 26:
 
=== Notes ===
 
=== Notes ===
  
The functions [[Squirrel/Functions/Misc/MessagePlayer|MessagePlayer]], [[Squirrel/Functions/Game/GetHour|GetHour]] and call [[Squirrel/Events/Player/OnPlayerCommand|OnPlayerCommand]] were used in in this example. More info about them in corresponding pages.
+
The functions [[Squirrel/Server/Functions/Messages/MessagePlayer|MessagePlayer]], [[Squirrel/Server/Functions/Game/GetHour|GetHour]] and call [[Squirrel/Server/Events/Player/onPlayerCommand|onPlayerCommand]] were used in in this example. More info about them in corresponding pages.
  
 
== Related Functions ==
 
== Related Functions ==
  
{{Squirrel/Functions/Game}}
+
{{Squirrel/Server/Functions/Game}}

Revision as of 23:14, 26 November 2009

Returns the current minute in the server.

Syntax

  1. int GetMinute()

Arguments

  • None

Example

This command will tell player the current time in the server when they type '/time'.

  1.  
  2. function onPlayerCommand( plr, cmd, text )
  3. {
  4. if ( cmd == "time" )
  5. {
  6. MessagePlayer( "Server time is: " + GetHour() + ":" + GetMinute(), plr );
  7. }
  8. }
  9.  

Notes

The functions MessagePlayer, GetHour and call onPlayerCommand were used in in this example. More info about them in corresponding pages.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox