Raised This Month: $138 Target: $400
 34% 

[ANY] ADVANCED and silent CVAR change [AGO 2019]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
axelnieves2012
Senior Member
Join Date: Oct 2014
Location: in my house
Plugin ID:
6662
Plugin Version:
1.1
Plugin Category:
Admin Commands
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Alternate sm_cvar. Allows you to change a cvar value without printing any result to chat. Opcionaly, you can print result to console or server; and/or add a delay.
    Old 07-30-2019 , 02:31   [ANY] ADVANCED and silent CVAR change [AGO 2019]
    Reply With Quote #1

    WELCOME

    INTRODUCTION:
    For months I've been looking for a way to get rid of those annoying chat reports whenever a CVAR changed (requested by admin, automatic plugins, etc), and I've not found a working solution.
    So I made this plugin.

    DESCRIPTION:
    This plugin adds new commands which replace sm_cvar, with the same functionality, and no chat spamming (it even works on FCVAR_NOTIFY convars).

    BONUS 1: You can also print result to server console. And you can also add a delay before a cvar is changed.
    *NEW*: Now you can set a cvar pointing to another cvar's value.

    INFO:
    Delay must be given as float string. 1.0=1 second // 0.5=half second.
    If omited, or <=0.0, plugin will change your cvar inmediatelly.

    REQUERIMENTS:
    - Sourcemod >= 1.9

    Change log:
    Version 1.1 [1 AGO 2019]
    - Added ability to set a cvar pointing to another cvar's value.
    Version 1.0 [30 JUL 2019] (23 downloads)
    - Initial release.

    Convars:
    PHP Code:
    sm_acvar_server_always "1"
    Print always result to server console when using sm_acvar and sm_adcvarIt`s a good idea enabling it if you pretend to use "sm_acvar" replacing "sm_cvar". 
    Admin commands:
    PHP Code:
    sm_acvar convar_name "convar value".
    Changes a cvar value without printing result to chatnor consolenor serverResult will be printed to server if sm_acvar_always is enabled.

    sm_acvar_console convar_name "convar value".
    Changes a cvar value printing result to admin`s console only. This command is not affected by sm_acvar_always.

    sm_acvar_server convar_name "convar value".
    Changes a cvar value printing result to server
    `s console only.

    sm_adcvar float:delay=0.0 convar_name "convar value".
    Changes a cvar value without printing result to chatnor consolenor serverCVar will be changed after specified delayResult will be printed to server if sm_acvar_always is enabled.

    sm_adcvar_console float:delay=0.0 convar_name "convar value".
    Changes a cvar value printing result to admin`s console only. CVar will be changed after specified delay. This command is not affected by sm_acvar_always.

    sm_adcvar_server float:delay=0.0 convar_name "convar value".
    Changes a cvar value printing result to server
    `s console onlyCVar will be changed after specified delay
    Console commands:
    No user commands implemented.

    Known bugs:
    - None at the moment. Please, report here.

    To do list:
    - Post suggestions here.

    Using CVar pointing to another CVar value:
    To set a cvar to another cvar's value, you should pass its name prepended by a dollar sign, AT THE VERY BEGINING OF THE ARGUMENT.
    Example 1:
    Code:
    sm_acvar mp_footsteps $mp_flashlight
    You can only point to one cvar per command.
    Above example will set "mp_footsteps" according to mp_flashlight's value.

    Example 2 (This is wrong):
    Code:
    sm_acvar hostname "welcome to $mp_gamemode"
    This will not work because you cannot point to a cvar in a mid-string.

    If you want to use a dollar sign at the begining of a string, and it doesnt be parsed as a cvar, you should use a double dollar sign to override its functionality.

    Example 3:
    Code:
    sm_acvar hostname "$$peedfire"
    Above code will set "hostname" to "$speedfire".


    Examples:
    sm_acvar sv_cheats 1
    Changes 'sv_cheats' to '1' without any chat message.
    sm_acvar_server hostname "L4D1 TANK RUSH 24/7"
    Changes 'hostname' to 'L4D1 TANK RUSH 24/7' and prints result to server console only.
    sm_adcvar_server 5.0 mp_friendlyfire 1
    Will change 'mp_friendlyfire' to '1' within next 5 seconds after command is entered. And result will be printed to serverīs console.
    sm_adcvar 0.1 sv_gametypes "coop, versus, teamversus"
    Will change 'sv_gametypes' to 'coop, versus, teamversus' within next 0.1 second after command is entered.
    Examples pointing to another cvar value:
    sm_acvar z_hunter_limit $survivor_limit
    Will set z_hunter_limit to survivor_limit's current value.
    sm_acvar mp_freezetime $mp_buytime
    Will set mp_freezetime to mp_buytime's current value.
    sm_acvar hostname "$$uPeR cR4zy $erVer"
    Will set hostname to $uPeR cR4zy $erver.
    IMPORTANT: In this example, only $$uPeR needs double '$' to avoid cvar pointing. $erVer doesn't need double dollar sign because it's not at the very begining of the string.
    Attached Files
    File Type: sp Get Plugin or Get Source (sm_acvar.sp - 27 views - 6.4 KB)

    Last edited by axelnieves2012; 08-01-2019 at 02:01.
    axelnieves2012 is offline
    aykocity
    Member
    Join Date: Sep 2017
    Old 07-30-2019 , 19:19   Re: [ANY] ADVANCED and silent CVAR change [JUL 2019]
    Reply With Quote #2

    hi;

    Quote:
    I have some requests

    Example:
    sm_adcvar_server 30.0 sm_blind @all 300
    sm_adcvar_server 50.0 sm_blind @all 0

    and reset each round
    thanks for sharing

    Last edited by aykocity; 07-30-2019 at 19:20.
    aykocity is offline
    axelnieves2012
    Senior Member
    Join Date: Oct 2014
    Location: in my house
    Old 07-30-2019 , 22:51   Re: [ANY] ADVANCED and silent CVAR change [JUL 2019]
    Reply With Quote #3

    Quote:
    Originally Posted by aykocity View Post
    hi;



    thanks for sharing
    Hello, I cannot understand your request. Can you explain me, please?
    I know a plugin that reloads current map (sm_reloadmap command).
    And I know a plugins that execs commands with delay (sm_delaycmd command).
    You can combine them:
    sm_delaycmd 5.0 sm_reloadmap.

    Is this what you are looking for?
    axelnieves2012 is offline
    aykocity
    Member
    Join Date: Sep 2017
    Old 07-31-2019 , 09:28   Re: [ANY] ADVANCED and silent CVAR change [JUL 2019]
    Reply With Quote #4

    no

    Quote:
    example:

    in de.cfg

    1.round
    sm_adcvar_server 30.0 sm_blind @all 300
    sm_adcvar_server 50.0 sm_blind @all 0

    2.round
    sm_adcvar_server 30.0 sm_blind @all 300
    sm_adcvar_server 50.0 sm_blind @all 0

    3.4.5.6.... etc..
    currently only works when the map is newly opened
    next rounds not working
    aykocity is offline
    axelnieves2012
    Senior Member
    Join Date: Oct 2014
    Location: in my house
    Old 07-31-2019 , 22:56   Re: [ANY] ADVANCED and silent CVAR change [JUL 2019]
    Reply With Quote #5

    Quote:
    Originally Posted by aykocity View Post
    no :(



    currently only works when the map is newly opened
    next rounds not working
    Hello. I think you may be confused. As I could see, "sm_blind" is a command.
    This script manages CONVARS, not commands.
    Tell me exactly what are you trying to do. Maybe you are using this plugin by mistake.

    I think you should do is:
    Code:
    sm_delaycmd 30.0 sm_blind @all 300
    sm_delaycmd 50.0 sm_blind @all 0
    In above code, you should know that both 'sm_delaycmd' commands are executed at the same time. This means that if you executed your CFG at 00:00:00s, you will blind @all at 0:00:30s. And @all will be unblinded at 0:00:50s, not at 0:01:20s.

    You should also use a plugin that automatically loads your CFG on each round.
    listenserver.cfg and server.cfg are executed on each mapchange, not on each new round.

    Last edited by axelnieves2012; 08-01-2019 at 01:27.
    axelnieves2012 is offline
    Reply


    Thread Tools
    Display Modes

    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 04:43.


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