|
| 1 | +# Description |
| 2 | +NextClientServerApi is an amxmodx module that provides an API to interact with Counter-Strike 1.6 NextClient. |
| 3 | + |
| 4 | +See API functions in [next_client_api.inc](https://github.com/Next21Team/NextClientServerApi/blob/main/addons/amxmodx/scripting/include/next_client_api.inc). |
| 5 | + |
| 6 | +# Features |
| 7 | + |
| 8 | +- The cvar sandbox. Allows you to set the value of a cvar to the client and locks it to be changed by the client. cvar value on the client is reset to the user's value after disconnecting from the server. |
| 9 | +- Effects for viewmodel. Allows you to set rendering effects for viewmodels, as well as skin and body. |
| 10 | +- Sprite management api. Allows you to display sprites on the screen. |
| 11 | +- Extended fov message. Allows you to set the interpolation time of the fov change. |
| 12 | +- Override of deathmsg weapon sprites. Allows you to customize weapon icons in kill feed. |
| 13 | + |
| 14 | +Coming soon: |
| 15 | +- Separate precaching for regular cs 1.6 client and NextClient. |
| 16 | +- Precaching hud.txt and default sprites. |
| 17 | + |
| 18 | +> 💎 **USING OF THE API TO GRANT PRIVILEGES** <br /> |
| 19 | +Since `NextClientServerApi 1.4.0` we introduced a verification method for players playing with nextclient by using `ncl_is_using_nextclient` native and some [RSA public keys](https://github.com/CS-NextClient/NextClientServerApi/tree/main/addons/amxmodx/data/nextclient_api/pkeys) which should be installed on the server to make verification work.<br /> |
| 20 | +The verification process is carried out only by nextclient since version `2.3.0`, where support for the new client-server protocol was introduced. For earlier versions, it is unfortunately impossible to reliably determine whether a player uses nextclient.<br /> |
| 21 | +Here is an example of using verification to provide access flags for players playing with updated nextclient: |
| 22 | +```c++ |
| 23 | +#include <amxmodx> |
| 24 | +#include <next_client_api> |
| 25 | + |
| 26 | +new const VIP_FLAGS[] = "f"; // the vip flags we are providing |
| 27 | + |
| 28 | +public ncl_client_api_ready(id) { |
| 29 | + // Check that the player has verified nextclient |
| 30 | + if(ncl_is_using_nextclient(id) == NCL_USING_VERIFICATED) |
| 31 | + set_user_flags(id, read_flags(VIP_FLAGS)); |
| 32 | +} |
| 33 | +``` |
| 34 | +
|
| 35 | +# NextClient specific cvars |
| 36 | +
|
| 37 | +| Cvar name | Default value | Available in sandbox | Description | |
| 38 | +| --- | --- | --- | --- | |
| 39 | +| viewmodel_disable_shift | 0 | Yes | Disable viewmodel shifting (when you looking up or down). | |
| 40 | +| viewmodel_offset_x | 0 | Yes | | |
| 41 | +| viewmodel_offset_y | 0 | Yes | | |
| 42 | +| viewmodel_offset_z | 0 | Yes | | |
| 43 | +| viewmodel_fov | 90 | No | Min: 70<br/>Max: 100 | |
| 44 | +| cl_crosshair_type | 0 | Yes | Crosshair type. 0 - crosshair, 1 - T-shaped, 2 - circle, 3 - dot. | |
| 45 | +| cl_bobstyle | 0 | Yes | 0 for default bob, 1 for old style bob and 2 for CS:GO style bob. | |
| 46 | +| cl_bobamt_vert | 0\.13 | Yes | Vertical scale for CS:GO style bob. | |
| 47 | +| cl_bobamt_lat | 0\.32 | Yes | Lateral scale for CS:GO style bob. | |
| 48 | +| cl_bob_lower_amt | 8 | Yes | Specifies how much the viewmodel moves inwards for CS:GO style bob. | |
| 49 | +| cl_rollangle | 0 | Yes | Screen roll angle when strafing or looking (Quake effect). | |
| 50 | +| cl_rollspeed | 200 | Yes | Screen roll speed when strafing or looking (Quake effect). | |
| 51 | +| viewmodel_lag_scale | 0 | Yes | The value of the lag of the viewmodel from the crosshair (CS:GO effect). | |
| 52 | +| viewmodel_lag_speed | 8 | Yes | The speed of the viewmodel following the crosshair (CS:GO effect). | |
| 53 | +| fov_horplus | 0 | No | Enables Hor+ scaling for FOV. Fixes the FOV when playing with aspect ratios besides 4:3. | |
| 54 | +| fov_angle | 90 | No (use ncl_setfov instead) | Min: 70<br/>Max: 100 | |
| 55 | +| fov_lerp | 0 | No (use ncl_setfov instead) | FOV interpolation time in seconds. | |
| 56 | +| hud_deathnotice_max | 5 | No | The maximum number of killfeed entries that can be displayed. | |
| 57 | +| hud_deathnotice_old | 0 | No | Enable the old style of killfeed. | |
| 58 | +
|
| 59 | +
|
| 60 | +## Building |
| 61 | +
|
| 62 | +Building NextClientServerApi requires CMake 3.10+ and GCC or MSVC compiler with C++11 support. Tested compilers are: |
| 63 | +
|
| 64 | +* GCC 9.4.0 |
| 65 | +* MSVC 2019 |
| 66 | +
|
| 67 | +Building the library is done using CMake. You can run the CMake GUI to configure the library or use the command line: |
| 68 | +
|
| 69 | +``` |
| 70 | +mkdir Release |
| 71 | +cd Release |
| 72 | +cmake .. -DCMAKE_BUILD_TYPE=Release |
| 73 | +cmake --build .. --target nextclientapi_amxx |
| 74 | +``` |
0 commit comments