Raised This Month: $ Target: $400
 0% 

[REQ] Change cvar depends on players on CS:GO server


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Nexicon
Senior Member
Join Date: Feb 2017
Old 06-04-2017 , 08:06   [REQ] Change cvar depends on players on CS:GO server
Reply With Quote #1

Hello,

I need a plugin that change cvar that depends on players on the server. It should check for players once in a while and change the cvar when it check the players..

Its for a Zombie Escape server. Like:
If under 20 people in the server = Lite mapcycle
If over 20 people in server = Full mapcycle

Eg: cvar "mapcyclefile" to "mapcycle_full.txt" and lite if under 20 inside. Or it can check when a new player connect/leave?

Hope someone will help.
Thanks

Last edited by Nexicon; 06-04-2017 at 08:12.
Nexicon is offline
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 - 259 views - 2.5 KB)
File Type: smx CDOP.smx (14.0 KB, 235 views)

Last edited by WatchDogs; 06-04-2017 at 12:01.
WatchDogs is offline
Nexicon
Senior Member
Join Date: Feb 2017
Old 06-04-2017 , 10:32   Re: [REQ] Change cvar depends on players on CS:GO server
Reply With Quote #3

Quote:
Originally Posted by WatchDogs View Post
Hi


Here is a simple plugin with built in Cvars.

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


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

Examples:
sm_cdop_cmds_lower "mapcyclefile mapcycle_lite.txt ; say Lower Than 20 ; mp_restartgame 1"
sm_cdop_cmds_higher "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 "mapcyclefile mapcycle_lite.txt" 
- Commands that plugin should run when players become lower that between (Separate with ';')

sm_cdop_cmds_higher "mapcyclefile mapcycle_full.txt"
- Commands that plugin should run when players become higher that between (Separate with ';')
Thank you very much! But it saying "[SM] Loaded plugin CDOP.smx successfully.Unknown command "mapcyclefile""

Maybe sm_cvar first or?
Nexicon is offline
WatchDogs
Senior Member
Join Date: Oct 2015
Location: Iran
Old 06-04-2017 , 10:38   Re: [REQ] Change cvar depends on players on CS:GO server
Reply With Quote #4

You're welcome Ya Ya, Just add sm_cvar at the begining of command.

Last edited by WatchDogs; 06-04-2017 at 10:44.
WatchDogs is offline
Nexicon
Senior Member
Join Date: Feb 2017
Old 06-04-2017 , 10:43   Re: [REQ] Change cvar depends on players on CS:GO server
Reply With Quote #5

If i type !rcon sm_cvar mapcyclefile mapcycle_lite.txt it change to the file but the plugin wont... Any idea?

EDIT: Works!! Possible you can add a text so it tell people why it change? Maybe a cvar to change the text

Last edited by Nexicon; 06-04-2017 at 10:47.
Nexicon is offline
WatchDogs
Senior Member
Join Date: Oct 2015
Location: Iran
Old 06-04-2017 , 11:04   Re: [REQ] Change cvar depends on players on CS:GO server
Reply With Quote #6

Here you are

Color supported message with multicolors.


Examples:
Code:
sm_cdop_msg_lower "{red}[SM] {lightgreen}Players {green}are {darkred}lower {blue}than {lime}value !"

sm_cdop_msg_higher "{red}[SM] {purple}Players {green}are {default}higher {blue}than {lime}value !"

EDIT: Download The Last Version From Up.

Last edited by WatchDogs; 06-04-2017 at 11:29.
WatchDogs is offline
Nexicon
Senior Member
Join Date: Feb 2017
Old 06-04-2017 , 11:19   Re: [REQ] Change cvar depends on players on CS:GO server
Reply With Quote #7

Quote:
Originally Posted by WatchDogs View Post
Here you are

Color supported message with multicolors.


Examples:
Code:
sm_cdop_msg_lower "{red}[SM] {lightgreen}Players {green}are {darkred}lower {blue}than {lime}value !"

sm_cdop_msg_higher "{red}[SM] {purple}Players {green}are {default}higher {blue}than {lime}value !"
You're the best! You should release this in "Plugins"
Nexicon is offline
WatchDogs
Senior Member
Join Date: Oct 2015
Location: Iran
Old 06-04-2017 , 11:26   Re: [REQ] Change cvar depends on players on CS:GO server
Reply With Quote #8

Thank you so much It was your idea

Working on it to add more features and will release it ;)


I forgot to fix a bug
that executes command and sends message on every connects & disconnects (SPAM) !

Here is a fixed version


EDIT: Download The Last Version From Up.

Last edited by WatchDogs; 06-04-2017 at 11:58.
WatchDogs is offline
Nexicon
Senior Member
Join Date: Feb 2017
Old 06-04-2017 , 11:40   Re: [REQ] Change cvar depends on players on CS:GO server
Reply With Quote #9

Thanks Works perfect!
Nexicon is offline
Nexicon
Senior Member
Join Date: Feb 2017
Old 06-04-2017 , 11:42   Re: [REQ] Change cvar depends on players on CS:GO server
Reply With Quote #10

When does it update the cvar? It did not update when a player joined
Nexicon is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:52.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode