ACSUtils Wiki

An ACS library for ZDoom-based ports

User Tools

Site Tools


functions:isclient

Table of Contents

IsClient

bool IsClient()

Description

Returns true if the script is running on a client.

Any running instance of ZDoom that has display and input capabilities is considered as a client.

If the instance is a client, graphics effects (clientside actors and hud) should be enabled for it.

The same instance can be both a client and a server (e.g. in singleplayer).

The following are clients:

  • A singleplayer game.
  • A client in client-server Zandronum multiplayer (but not the server).
  • A client that is also acting as a server for other clients (this mode is not supported in Zandronum yet but other game engines have it).
All players are both servers and clients in (G)ZDoom multiplayer, which is not client-server.

Examples

Using IsClient and IsServer ensures that your mod runs correctly in both singleplayer and multiplayer:

if (IsServer())
{
    // Run serverside code.
}
if (IsClient())
{
    // Run clientside code.
}
functions/isclient.1489764420.txt.gz ยท Last modified: 2017/03/17 17:27 by korshun