client.console: Difference between revisions
(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 | |usage = fetch the status of whether the client is the server console | ||
|returnInfo = the status of whether the client is the | |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
Online and Offline
Read-Only
bool client.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
getClient
getClientFromPlayerElement
getClients
localClient
client.administrator
client.cameraInterior
client.console
client.despawnPlayer
client.disconnect
client.game
client.gameVersion
client.getData
client.index
client.ip
client.name
client.ping
client.player
client.removeAllData
client.removeData
client.setData
Client Related
getClient
getClientFromPlayerElement
getClients
localClient
client.administrator
client.console
client.despawnPlayer
client.disconnect
client.game
client.gameVersion
client.getData
client.index
client.ip
client.name
client.ping
client.player
client.removeAllData
client.removeData
client.setData