client.console: Difference between revisions

From GTA Connected
Jump to navigation Jump to search
(Created page with "{{ScriptItem |endpoint = shared |type = property |class = Client |name = console |returnTypes = bool |readonly = true |usage = fetch the status of whether the client is the ho...")
 
No edit summary
 
Line 6: Line 6:
|returnTypes = bool
|returnTypes = bool
|readonly = true
|readonly = true
|usage = fetch the status of whether the client is the host of the peer2peer server
|usage = fetch the status of whether the client is the server console
|returnInfo = the status of whether the client is the host of the peer2peer server
|returnInfo = the status of whether the client is server console
|exampleJSSS = addCommandHandler("test", function(command, params, client) {
  if(client.console == true) {
    // This command was used by the server console
  }
});
|notes = Due to the universal design of the server and client (internally called "net machines"), the server itself ''is'' a client. Since the server window/console accepts input, this property is available to check if the client is indeed the server. This is useful if you want to make a command only usable by the server console. Just add a command handler, and a simple check if the command was typed into the server console (instead of a player using the chatbox). See example on this page. It also works anywhere you want to check if a client object is the server.
}}
}}

Latest revision as of 02:37, 20 February 2025

Property Server and Client GTAIII Logo.png icon-vc.png icon-sa.png icon-iv.png Online and Offline Read-Only

Available since Server 1.0.0, Client 1.0.0
bool client.console
The client.console property is used to fetch the status of whether the client is the server console.

Value

bool The status of whether the client is server console.
readonly This property cannot be changed.

Types

Shared Client

Notes

  • Due to the universal design of the server and client (internally called "net machines"), the server itself is a client. Since the server window/console accepts input, this property is available to check if the client is indeed the server. This is useful if you want to make a command only usable by the server console. Just add a command handler, and a simple check if the command was typed into the server console (instead of a player using the chatbox). See example on this page. It also works anywhere you want to check if a client object is the server.

Examples

Example 1 - JavaScript - Server-Side:

addCommandHandler("test", function(command, params, client) {
  if(client.console == true) {
    // This command was used by the server console
  }
});

Compatibility

There isn't any compatibility information for this property.

Related

Server Related

GTAIII Logo.png icon-vc.png icon-sa.png icon-iv.png getClient
GTAIII Logo.png icon-vc.png icon-sa.png icon-iv.png getClientFromPlayerElement
GTAIII Logo.png icon-vc.png icon-sa.png icon-iv.png getClients
GTAIII Logo.png icon-vc.png icon-sa.png icon-iv.png localClient

GTAIII Logo.png icon-vc.png icon-sa.png icon-iv.png client.administrator
GTAIII Logo.png icon-vc.png icon-sa.png icon-iv.png client.cameraInterior
GTAIII Logo.png icon-vc.png icon-sa.png icon-iv.png client.console
GTAIII Logo.png icon-vc.png icon-sa.png icon-iv.png client.despawnPlayer
GTAIII Logo.png icon-vc.png icon-sa.png icon-iv.png client.disconnect
GTAIII Logo.png icon-vc.png icon-sa.png icon-iv.png client.game
GTAIII Logo.png icon-vc.png icon-sa.png icon-iv.png client.gameVersion
GTAIII Logo.png icon-vc.png icon-sa.png icon-iv.png client.getData
GTAIII Logo.png icon-vc.png icon-sa.png icon-iv.png client.index
GTAIII Logo.png icon-vc.png icon-sa.png icon-iv.png client.ip
GTAIII Logo.png icon-vc.png icon-sa.png icon-iv.png client.name
GTAIII Logo.png icon-vc.png icon-sa.png icon-iv.png client.ping
GTAIII Logo.png icon-vc.png icon-sa.png icon-iv.png client.player
GTAIII Logo.png icon-vc.png icon-sa.png icon-iv.png client.removeAllData
GTAIII Logo.png icon-vc.png icon-sa.png icon-iv.png client.removeData
GTAIII Logo.png icon-vc.png icon-sa.png icon-iv.png client.setData


Client Related

GTAIII Logo.png icon-vc.png icon-sa.png icon-iv.png getClient
GTAIII Logo.png icon-vc.png icon-sa.png icon-iv.png getClientFromPlayerElement
GTAIII Logo.png icon-vc.png icon-sa.png icon-iv.png getClients
GTAIII Logo.png icon-vc.png icon-sa.png icon-iv.png localClient

GTAIII Logo.png icon-vc.png icon-sa.png icon-iv.png client.administrator
GTAIII Logo.png icon-vc.png icon-sa.png icon-iv.png client.console
GTAIII Logo.png icon-vc.png icon-sa.png icon-iv.png client.despawnPlayer
GTAIII Logo.png icon-vc.png icon-sa.png icon-iv.png client.disconnect
GTAIII Logo.png icon-vc.png icon-sa.png icon-iv.png client.game
GTAIII Logo.png icon-vc.png icon-sa.png icon-iv.png client.gameVersion
GTAIII Logo.png icon-vc.png icon-sa.png icon-iv.png client.getData
GTAIII Logo.png icon-vc.png icon-sa.png icon-iv.png client.index
GTAIII Logo.png icon-vc.png icon-sa.png icon-iv.png client.ip
GTAIII Logo.png icon-vc.png icon-sa.png icon-iv.png client.name
GTAIII Logo.png icon-vc.png icon-sa.png icon-iv.png client.ping
GTAIII Logo.png icon-vc.png icon-sa.png icon-iv.png client.player
GTAIII Logo.png icon-vc.png icon-sa.png icon-iv.png client.removeAllData
GTAIII Logo.png icon-vc.png icon-sa.png icon-iv.png client.removeData
GTAIII Logo.png icon-vc.png icon-sa.png icon-iv.png client.setData