User Tools

Site Tools


scripting:reference:system_functions:miscfunctions

Misc other functions

System functions that don't fall into any other particular category

sysRealTime

Format sysRealTime ( Type )
Description Returns details of the current real time (according to the server clock)
Returns Depending on the type field:
Year - returns the current year (e.g. 2014)
Month - returns the current month number (1 to 12)
Day - returns the current day number (1 to 31)
Hour - returns the current hour (0 to 23)
Minute - returns the current minute (0 to 59)
Second - returns the current second (0 to 59)
UnixTime - number of seconds passed since 1st Jan, 1970

Example:

Event( "UseItem", "Tea" )
{
   $hour = sysRealTime( "Hour" )
   if ( $hour < 18 )
   {
      *msg %PLAYER% Tea can only be used at tea-time (6pm - 8pm)
    }
    else if ( $hour >= 20 )
    {
      *msg %PLAYER% Tea can only be used at tea-time (6pm - 8pm)    
    }
    else
    {
        *notifylarge %PLAYER% Tea-time!
    }
}

sysRaceIsActive

Format sysRaceIsActive ( Course_Num )
Description Returns 1 if the specified race number is currently active ; this can include being in a pre-race setup stage or post-race results screen
Returns 1 or 0


sysGetStaticFlagState

sysGetStaticFlagState( flagNum ) - Static flag state is usually either 0 (no team owns it) or the team number that last touched the flag. (FIXMENot sure if the game copes with teams other than 1 & 2 playing with crow flags?)

sysSetStaticFlagState

sysSetStaticFlagState( FlagNum, State ) sets the specified flag to be owned by a particular team (if State >= 1 ) or un-owned if State is 0

sysGetNumStaticFlags

sysGetNumStaticFlags( State ) returns the number of static flags that are in the specified state.

sysGetTotalNumStaticFlags

sysGetTotalNumStaticFlags () returns the total number of static flags on the map

Battle game Functions

BattleSetPreludeTime

BattleSetNumRounds

BattleSetRoundTime

BattleSetRoundScore

BattleSendChallenge

Background model Functions

FIXME : Not sure what the state of these functions is atm - many of the use cases for this are covered by the entity system - needs investigation

sysAddLocalBackgroundModel

TBD

sysDeleteLocalBackgroundModel

TBD

sysDeleteAllLocalBackgroundModels

TBD

sysAddBackgroundModels

TBD

scripting/reference/system_functions/miscfunctions.txt · Last modified: 2023/04/15 09:04 by mit

Except where otherwise noted, content on this wiki is licensed under the following license: Public Domain
Public Domain Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki