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
(Created page with "This function will set the game minute. == Syntax == <pre>SetTime( hour, minute )</pre> == Arguments == * ''int'' '''hour'''' - The hour of the game (from 00 to 23) * ''in...")
 
No edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 7: Line 7:
== Arguments ==
== Arguments ==


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


== 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