Scripting/Squirrel/Functions/SetTime: Difference between revisions

From Vice City Multiplayer
Jump to navigation Jump to search
Caution icon
This wiki is using an old backup from 2020
Some information may be old/missing
No edit summary
No edit summary
 
(One intermediate revision by one other user not shown)
Line 12: Line 12:
== Example ==
== Example ==


{{Scripting/Needs_Example}}
<source lang=squirrel>
function onPlayerCommand( player, cmd, text )
{
if ( cmd == "settime" )
{
  If ( !text ) MessagePlayer( "Format: /settime <hr> <min>"", player );
  else
  {
  local a = split(text, " ")
  if ( !IsNum( a[0] ) MessagePlayer( "Format: /settime <hr> <min>"", player );
  else if ( !IsNum( a[1] ) MessagePlayer( "Format: /settime <hr> <min>"", player );
  else SetTime( a[0], a[1] );
  }
}
}
</source>


=== Notes ===
=== Notes ===


== Related Functions ==
== Related Functions ==


{{Scripting/Squirrel/Functions/Server_Settings}}
{{Scripting/Squirrel/Functions/Server_Settings}}
[[Category:Scripting/Squirrel/Functions/Server_Settings _Functions]]

Latest revision as of 21:50, 30 January 2017

This function will set the game minute.

Syntax

SetTime( hour, minute )

Arguments

  • int hour - The hour of the game (from 00 to 23)
  • int minute - The minute of the game (from 00 to 59)

Example

function onPlayerCommand( player, cmd, text )
{
 if ( cmd == "settime" )
 {
  If ( !text ) MessagePlayer( "Format: /settime <hr> <min>"", player );
  else
  {
   local a = split(text, " ")
   if ( !IsNum( a[0] ) MessagePlayer( "Format: /settime <hr> <min>"", player );
   else if ( !IsNum( a[1] ) MessagePlayer( "Format: /settime <hr> <min>"", player );
   else SetTime( a[0], a[1] );
  }
 }
}

Notes

Related Functions