ACSUtils Wiki

An ACS library for ZDoom-based ports

User Tools

Site Tools


functions:isclient

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
functions:isclient [2017/03/17 17:33] – [Examples] korshunfunctions:isclient [2019/08/26 04:23] (current) – removed korshun
Line 1: Line 1:
-====== IsClient ====== 
-{{tag>zdoom zandronum info needs_examples}} 
-''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. 
- 
-<note tip>The same instance can be both a client and a server (e.g. in singleplayer).</note> 
- 
-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). 
-  * A player in (G)ZDoom multiplayer, which is not client-server, but makes all players run exactly the same game. 
- 
-<note important>**All** players are both servers and clients in **(G)ZDoom multiplayer**, which is not client-server.</note> 
- 
-===== Examples ===== 
-Using IsClient and [[IsServer]] ensures that your mod runs correctly in both singleplayer and multiplayer: 
-<code> 
-if (IsServer()) 
-{ 
-    // Run serverside gameplay code. 
-} 
-if (IsClient()) 
-{ 
-    // Draw hud, spawn effects. 
-} 
-</code> 
functions/isclient.1489764816.txt.gz · Last modified: 2017/03/17 17:33 by korshun