Skip to content

get

These function(s) get information for you to process from Constellation. See sdk_test.html for all usage.

localplayer

Description

Gets the localplayer information in an object.

Returns

  • object

Remarks

  • The keys inside this object are bound to change per update. To see the latest keys, simply dump the object like so:

console.log( constellation.get.localplayer() )

Example

/// get localplayer
var localplayer = constellation.get.localplayer()

/// are we even ingame?
if( localplayer == null ) return null

/// say hi to ourselves
console.log( "Hello " + localplayer.name )

players

Description

Gets all server player information in an object.

Returns

  • object

Remarks

  • The data for each player needs to be parsed in JSON.
  • The keys inside this object are bound to change per update. To see the latest keys, simply dump the object like so:

console.log( constellation.get.players() )

Example

/// get localplayer
var localplayer = constellation.get.localplayer()

/// are we even ingame?
if( localplayer == null ) return null

/// we're ingame, get all players while we're at it
var player_database = constellation.get.players() 

/// loop through our database
for( const property in player_database )
{
    /// parse
    const json_information = JSON.parse(player_database[property])

    /// dump steam ID of every player into console.
    console.log( `${json_information.name}: ${json_information.steam}` )
}


weapon

Description

Gets the localplayer's weapon in an object.

Returns

  • object

Remarks

  • The keys inside this object are bound to change per update. To see the latest keys, simply dump the object like so:

console.log( constellation.get.weapon() )