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

DM Pause v2.0 - n0br41ner


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   General Purpose       
n0br41ner
Senior Member
Join Date: May 2012
Location: Planet Earth
Old 07-21-2012 , 16:54   DM Pause v2.0 - n0br41ner
Reply With Quote #1

DM Pause:
------------

This plugin will enable normal players to pause there stats during a deathmatch game. When a player types "/pause" (without quotes), he becomes paused until he types "/unpause" (without quotes). Being paused is that you are transfered to spectator, you won't be able to change teams. This is very helpful to players who get interrupted very often who can just type "/pause" (without quotes) if they want to be AFK for a couple of minutes without loosing their frags:death ratio. This plugin can be used with normal servers (not running deathmatch mode) if you feel that this will is useful.

This plugin has a feature that will advertise the functionality to the players every minute. Admins now have the possibility to pause/unpause players via console commands.


Commands:
-------------

Clients:
-------
  • say /pause - Pauses the player
  • say /unpause - Unpauses the player
  • say_team /pause - Pauses the player
  • say_team /unpause - Unpauses the player
Admins:
--------
  • amx_pauseplayer <name|id> - Pauses a player
  • amx_unpauseplayer <name|id> - Unpause a player


Cvars:
--------
  • amx_dmpause <1|0> - (default: 1) Enable the plugin
  • amx_dmpause_ad <1|0> - (default: 1) Enable the advertising function
  • amx_dmpause_adtime <#> - (default: 5) Set the time for the advertisement


Installation:
--------------
  • Copy DMPause.amxx to cstrike/addons/amxmodx/plugins
  • Go to cstrike/addons/amxmodx/configs/plugins.ini and add: DMPause.amxx


Modules:
----------

amxmodx
cstrike
fun


Credits:
---------
  • MPNumb for his help in improving the code.
  • Doc-Holiday for his idea to make a cvar for the advertising time.


Change Log:
--------------

1.0: 21/JULY/2012
  • initial release
1.1: 24/JULY/2012
  • added cvar for changing advertisement time
2.0: 25/JULY/2012
  • added command for admins to pause players
  • added command for admins to unpause players


To do:
-------
  • Add a command for admins to pause/unpause players (DONE)
  • Add MultiLingual support

16 views reset
2 views reset
Attached Files
File Type: sma Get Plugin or Get Source (DMPause.sma - 1096 views - 10.4 KB)
__________________

Last edited by n0br41ner; 10-21-2012 at 10:42.
n0br41ner is offline
isotonic
AlliedModders Donor
Join Date: Jun 2011
Location: Moscow, Russia
Old 07-23-2012 , 20:03   Re: DM Pause v1.0 - n0br41ner
Reply With Quote #2

Quote:
Originally Posted by n0br41ner View Post
This plugin has a feature that will advertise the functionality to the players every minute.
It is too often. I suggest at least 5 minutes.
__________________
isotonic is offline
Old 07-23-2012, 21:46
n0br41ner
This message has been deleted by n0br41ner. Reason: nvm
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 07-24-2012 , 02:05   Re: DM Pause v1.0 - n0br41ner
Reply With Quote #3

should make that a cvar so you dont have to recompile the plugin every time they want ot change it

PHP Code:
g_iTimeToAdvertise register_cvar("cvar_timetoadvertise""5"); // time in minuets to advertise

//Function to set task
new Float:TimeToAdvertise = (get_pcvar_float(g_iTimeToAdvertise) * 60.0); //Calculate time in seconds for a set task 

Last edited by Doc-Holiday; 07-24-2012 at 02:08.
Doc-Holiday is offline
n0br41ner
Senior Member
Join Date: May 2012
Location: Planet Earth
Old 07-24-2012 , 12:22   Re: DM Pause v1.1 - n0br41ner
Reply With Quote #4

Plugin updated to version 1.1
Please see main post for the change log.
__________________
n0br41ner is offline
n0br41ner
Senior Member
Join Date: May 2012
Location: Planet Earth
Old 07-24-2012 , 18:30   Re: DM Pause v2.0 - n0br41ner
Reply With Quote #5

Plugin updated to version 2.0
Please see main post for the change log.
__________________
n0br41ner is offline
RaHBeR
๏_๏
Join Date: Jul 2012
Old 10-29-2012 , 22:51   Re: DM Pause v2.0 - n0br41ner
Reply With Quote #6

A nice plugin. Will post more ideas as soon as I test it.
RaHBeR is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 04-10-2016 , 07:13   Re: DM Pause v2.0 - n0br41ner
Reply With Quote #7

You forgot to deal with old style menu, currently your code works only for VGUI menu.
PHP Code:
get_user_name(iPlayerIDszPausedPlayer32); 
that's wrong, you should go until sizeof - 1, not sizeof.

PHP Code:
cs_set_user_deaths(iPlayerIDiPlayerDeaths 1);
cs_set_user_deaths(iPlayerIDiPlayerDeaths 1);
set_user_frags(iPlayerIDiPlayerFrags 1);
set_user_frags(iPlayerIDiPlayerFrags 1); 
Ugly fix, just send a ScoreInfo message.

Unapproved until you fix this.
__________________

Last edited by HamletEagle; 04-10-2016 at 07:14.
HamletEagle 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 07:33.


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