Skip to content

Repository files navigation

Description

NextClientServerApi is an amxmodx module that provides an API to interact with Counter-Strike 1.6 NextClient.

See API functions in next_client_api.inc.

Features

  • 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.
  • Effects for viewmodel. Allows you to set rendering effects for viewmodels, as well as skin and body.
  • Sprite management api. Allows you to display sprites on the screen.
  • Extended fov message. Allows you to set the interpolation time of the fov change.
  • Override of deathmsg weapon sprites. Allows you to customize weapon icons in kill feed.
  • Weapon sound override. Allows you to replace the sound of a specific weapon entity for NextClient players who can see it.
  • Mouse inversion. Allows you to invert the pitch and/or yaw mouse axes of the client.
  • Player verification. Allows you to reliably determine whether a player is using NextClient (see the section below).
  • Separate precaching for regular cs 1.6 client and NextClient. Allows you to precache models and sounds into the server's private directory, override default resources and update them on the client when they change on the server.
  • Uploading files to NextClient players (including hud.txt) into the server's private directory, without consuming a server precache slot.

💎 USING OF THE API TO GRANT PRIVILEGES
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 which should be installed on the server to make verification work.
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.
Here is an example of using verification to provide access flags for players playing with updated nextclient:

#include<amxmodx>
#include<next_client_api>newconstVIP_FLAGS[] = "f"; // the vip flags we are providing
public ncl_client_api_ready(id) {
// Check that the player has verified nextclientif(ncl_is_using_nextclient(id) == NCL_USING_VERIFICATED)
set_user_flags(id, read_flags(VIP_FLAGS));
}

NextClient specific cvars

Cvar nameDefault valueAvailable in sandboxDescription
viewmodel_disable_shift0YesDisable viewmodel shifting (when you looking up or down).
viewmodel_offset_x0Yes
viewmodel_offset_y0Yes
viewmodel_offset_z0Yes
viewmodel_fov90YesMin: 70
Max: 100
cl_crosshair_type0YesCrosshair type. 0 - crosshair, 1 - T-shaped, 2 - circle, 3 - dot.
cl_bobstyle0Yes0 for default bob, 1 for old style bob and 2 for CS:GO style bob.
cl_bobamt_vert0.13YesVertical scale for CS:GO style bob.
cl_bobamt_lat0.32YesLateral scale for CS:GO style bob.
cl_bob_lower_amt8YesSpecifies how much the viewmodel moves inwards for CS:GO style bob.
cl_rollangle0YesScreen roll angle when strafing or looking (Quake effect).
cl_rollspeed200YesScreen roll speed when strafing or looking (Quake effect).
viewmodel_lag_scale0YesThe value of the lag of the viewmodel from the crosshair (CS:GO effect).
viewmodel_lag_speed8YesThe speed of the viewmodel following the crosshair (CS:GO effect).
fov_horplus0NoEnables Hor+ scaling for FOV. Fixes the FOV when playing with aspect ratios besides 4:3.
fov_angle90No (use ncl_setfov instead)Min: 70
Max: 100
fov_lerp0No (use ncl_setfov instead)FOV interpolation time in seconds.
hud_deathnotice_max5YesThe maximum number of killfeed entries that can be displayed.
hud_deathnotice_old0NoEnable the old style of killfeed.

Building

Building NextClientServerApi requires CMake 3.16+ and GCC or MSVC compiler with C++17 support. Tested compilers are:

  • GCC 9
  • MSVC 2022

Building the library is done using CMake. You can run the CMake GUI to configure the library or use the command line:

mkdir Release
cd Release
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build . --target nextclientapi_amxx

About

NextClientServerApi is an amxmodx module that provides an API to interact with Counter-Strike 1.6 NextClient.

Resources

Stars

41 stars

Watchers

5 watching

Forks

Releases

Packages

Contributors

Languages