Raised This Month: $51 Target: $400
 12% 

Player-Based CVARs


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Plugin Info:     Modification:   ALL        Category:   Admin Commands        Approver:   Arkshine (91)
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 10-21-2011 , 19:24   Player-Based CVARs
Reply With Quote #1

Player-Based CVARs

By: nikhilgupta345

Description:
This plugin allows you to execute certain commands or set certain cvars when there are a certain number of players on the server. The commands are sent to the server console as soon as a player connects.

Admin Commands:
    • amx_addautocommand <players> <command> - Adds a command to be executed when there are "players" amount of players on the server.
    • amx_addautocvar <players> <cvar_name> <cvar_value> - Adds a cvar to be changed when there are "players" amount of players on the server.

Installation:
    • Click 'Get Plugin' link below
    • Place 'player_amount_cvars.amxx' in addons/amxmodx/plugins/ folder
    • Open addons/amxmodx/configs/plugins.ini
    • Add the line 'player_amount_cvars.amxx' at the bottom
    • Either create 'player_cvars.ini' on your own in the configs folder
    • Set it up to your liking.
    • Restart server or change map


Example 'player_cvars.ini':
    • An example player_cvars.ini may look like this:
      Code:
      [1]
      mp_freezetime 2
      mp_startmoney 8000
      sv_gravity 200
      
      [3]
      mp_freezetime 1
      mp_startmoney 1000
      sv_gravity 800
    • In brackets '[]', include how many players you want in the server when the commands below it execute.


Changelog:

  • Code:
    October 21, 2011
    • -v1.0-
      • Initial Release
    October 22, 2011
    • -v1.0.1-
      • Changed way of detecting player connect/disconnect
    • -v1.1-
      • Changed way of setting up file
      • Added admin commands
    July 07, 2012
    • -v1.1.1-
      • Removed one of the connect methods and used one method for both hooks.
      • Other small optimizations

Notes:
    • Some commands/cvars, such as mp_startmoney, will not take effect on the connecting player. For those commands, you should have it set for the player before, so it will work for the player you want it to. For example, if you want startmoney to be 10000 when there are 5 people, have "mp_startmoney 10000" under '4' in the config file.

Suggestions/Comments/Feedback are welcome.
Attached Files
File Type: txt player_cvars.txt (291 Bytes, 550 views)
File Type: sma Get Plugin or Get Source (player_amount_cvars.sma - 1215 views - 8.6 KB)
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please

Last edited by nikhilgupta345; 07-07-2012 at 00:28.
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
 



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 08:36.


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