View Single Post
WatchDogs
Senior Member
Join Date: Oct 2015
Location: Iran
Old 06-04-2017 , 09:24   Re: [REQ] Change cvar depends on players on CS:GO server
Reply With Quote #2

Hi


Here is a simple plugin with built in Cvars.

When players become less than 20 ---> Command Execute: "sm_cvar mapcyclefile mapcycle_lite.txt"
When players become equal or more than 20 ---> Command Execute: "sm_cvar mapcyclefile mapcycle_full.txt"


If you want more than 1 command to run you can separate it with ';'

Examples:
sm_cdop_cmds_lower "sm_cvar mapcyclefile mapcycle_lite.txt ; say Lower Than 20 ; mp_restartgame 1"
sm_cdop_cmds_higher "sm_cvar mapcyclefile mapcycle_full.txt ; say Higher Than 20 ; mp_restartgame 1"


Install:
Just Drag .smx file to your plugins folder.

Cfg file will create in cfg/sourcemod.

Code:
sm_cdop_between "20" 
- The number of players that plugin checks lower and higher of it to run commands

sm_cdop_cmds_lower "sm_cvar mapcyclefile mapcycle_lite.txt" 
- Commands that plugin should run when players become lower that between (Separate with ';')

sm_cdop_cmds_higher "sm_cvar mapcyclefile mapcycle_full.txt"
- Commands that plugin should run when players become higher that between (Separate with ';')

sm_cdop_msg_lower "{green}[SM] {default}Players's count is low!"
- Message to print in chat when players are lower than between value (Color supported)

sm_cdop_msg_higher "{green}[SM] {default}Players's count is high!"
- Message to print in chat when players are higher than between value (Color supported)

EDIT: Updated to 1.1 | Added sm_cvar at the beginning of default command.
EDIT: Updated to 1.2 | Added message to print when players become higher or lower + Multi Color support
EDIT: Updated to 1.3 | Fixed spam bug
EDIT: Updated to 1.4 | Fixed on map change bug
Attached Files
File Type: sp Get Plugin or Get Source (CDOP.sp - 257 views - 2.5 KB)
File Type: smx CDOP.smx (14.0 KB, 232 views)

Last edited by WatchDogs; 06-04-2017 at 12:01.
WatchDogs is offline