Raised This Month: $100 Target: $400
 25% 

Toggle Immunity (UPDATED: 07/1/06)


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Half-Life        Category:   Server Management        Approver:   devicenull (200)
slmclarengt
Veteran Member
Join Date: Jul 2004
Location: The Cookie Jar... or Pul
Old 08-09-2004 , 19:38   Toggle Immunity (UPDATED: 07/1/06)
Reply With Quote #1

Toggle Immunity by Slmclarengt
Formerly Known as VotorX's Change immune (see Reason for re-writing for more information)

Description:

Allows an administrator with the flag of ADMIN_RCON (l) to have the capability of removing another administrators or even their own immunity, thus leaving the victim vulnerable to all admin commands.

Credit(s):

VotorX (original author - for original version)
slmclarengt (myself - for idea and for rewriting it)
And all people who made suggestions/requests/comments

Cvars:
sv_allowignore <0|1> - controls whether to allow admins the ability to remove/set immunity of users. Default 1.
disclude_self <0|1> - disclude self from immunity being revoked. Default 1.

Use:
amx_immuneoff <name | #userid>
amx_immuneon <name | #userid>
amx_globalimmuneoff - Turns immunity off of everyone w/ immunity
amx_globalimmuneon - Turns immunity on for everyone authorized
amx_teamimmuneon < 1 for T, 2 for CT > - turns specified Team's immunity on
amx_teamimmuneoff < 1 for T, 2 for CT > - turns specified Team's immunity off


Reason for re-writing:

I re-wrote this plugin because VotorX's version was confusing, hard to read, did not do it's function, was messy, was unorganized, and in general, was just too complex and intricate.

Code:
#include <amxmodx> #include <amxmisc>

Newest version:
3.12b (7/1/06)
3.12 (5/13/06)
3.11 (05/08/06)
3.1 (05/07/06)
3.0 (01/05/06)

Changelog:
(7/1/06) - 3.12b):
Fixed code for amx_globalimmuneoff
Fixed code for amx_globalimmuneon
Optimized and moved comments to become more organized
(05/13/06 - 3.12):
Rewrote code for amx_globalimmuneoff
Rewrote code for amx_globalimmuneon
Optimized code to avoid unnecessary memory allocations
(05/07/06 - 3.1):
Added amx_globalimmuneoff to remove immunity from everyone who has it
Added amx_globalimmuneon to restore immunity to those authorized
(01/05/06 - 3.0):
Re-written for optimization and logic
All known errors/bugs/warnings/typos diminished
sv_allowignore cvar does it's function
No more errors or warnings on compilation

NOTE: Ignore all posts dating prior to January 5th, 2006 as they are inaccurate.
Attached Files
File Type: sma Get Plugin or Get Source (amx_toggleimmune.sma - 6390 views - 10.5 KB)
__________________
But we donít beat the Reaper by living longer. We beat the Reaper by living well. -Dr. Randy Pausch, R.I.P.

Come play WC3:FT on BnD Clan Server! You know you want to: Connect to WC3:FT BnD - go ahead click me!

Last edited by slmclarengt; 04-28-2007 at 00:44.
slmclarengt is offline
knocker
Senior Member
Join Date: Mar 2004
Old 08-10-2004 , 08:49  
Reply With Quote #2

turning the immunity off seems to be working. but turning it on again doesnt work until i change the map/restart server etc.
knocker is offline
Send a message via ICQ to knocker
Ingram
Veteran Member
Join Date: May 2004
Old 08-10-2004 , 15:55  
Reply With Quote #3

yeah if u look at the code, its easy to spot the problem (return PLUGIN_HANDLED) . I would fix it, but its his code.
Ingram is offline
slmclarengt
Veteran Member
Join Date: Jul 2004
Location: The Cookie Jar... or Pul
Old 08-11-2004 , 06:25   !PLUG
Reply With Quote #4

I dont think he'd mind. I would change it but I know i'd screw something up. Here is the updated version that JJKiller edited (TY). I also wondered if he would add @team and @all immunity on/off. Thanks. Remember, 'I' did none of the coding (I am just the tester). VotorX - Original Coder
JJKiller - Editor.

(EDIT: Check first post for working version)
__________________
But we donít beat the Reaper by living longer. We beat the Reaper by living well. -Dr. Randy Pausch, R.I.P.

Come play WC3:FT on BnD Clan Server! You know you want to: Connect to WC3:FT BnD - go ahead click me!
slmclarengt is offline
Votorx
Senior Member
Join Date: Jun 2004
Old 08-14-2004 , 00:44  
Reply With Quote #5

This should do what you want.
Attached Files
File Type: sma Get Plugin or Get Source (amx_changeimmune.sma - 1750 views - 5.3 KB)
Votorx is offline
Send a message via AIM to Votorx Send a message via MSN to Votorx Send a message via Yahoo to Votorx
slmclarengt
Veteran Member
Join Date: Jul 2004
Location: The Cookie Jar... or Pul
Old 08-17-2004 , 18:51  
Reply With Quote #6

BTW: If you couldnt tell by the name of the plugin, it removes immunity from either a player/team/all admins that are present. Usage: rcon or amx_rcon/cvar sv_allowignore <0/1> to allow ignored immunity. To turn a player's immunity off, type in console amx_immuneoff <Name or #userid> To turn immunity back on the player, type in console amx_immuneon <Name or #userid>. To take immunity off of admins on one team, type amx_teamimmuneoff <team # 1 for T's 2 for Ct's>. To turn immunity back on the team, type amx_teamimmuneon <team # 1 for T's 2 for Ct's>. To take all admins in servers immunity off, type amx_globalimmuneoff and to turn immunity back on for all, type amx_globalimmuneon. If you wish to "Disclude yourself" from having immunity taken off yourself, type rcon amx_rcon/cvar disclude_self 1 then type one of the above commands in console.
slmclarengt is offline
jackflack
Member
Join Date: Mar 2004
Location: Temecula, CA
Old 10-07-2004 , 20:16  
Reply With Quote #7

Quote:
Originally Posted by slmclarengt
BTW: If you couldnt tell by the name of the plugin, it removes immunity from either a player/team/all admins that are present. Usage: rcon or amx_rcon/cvar sv_allowignore <0/1> to allow ignored immunity. To turn a player's immunity off, type in console amx_immuneoff <Name or #userid> To turn immunity back on the player, type in console amx_immuneon <Name or #userid>. To take immunity off of admins on one team, type amx_teamimmuneoff <team # 1 for T's 2 for Ct's>. To turn immunity back on the team, type amx_teamimmuneon <team # 1 for T's 2 for Ct's>. To take all admins in servers immunity off, type amx_globalimmuneoff and to turn immunity back on for all, type amx_globalimmuneon. If you wish to "Disclude yourself" from having immunity taken off yourself, type rcon amx_rcon/cvar disclude_self 1 then type one of the above commands in console.
I am trying to use this for .20 RC6.

The problem I am having is it seems to load correctly, but when i try and set the CVAR sv_allowignore 1 nothing happens. When i type amx_cvar sv_allowignore 1 it says

Code:
amx_cvar sv_allowignore 1 [AMXX] Unknown cvar: sv_allowignore

Is there something i am missing? or does this just not work. Is there another way to check if a CVAR is loaded?

-jack
jackflack is offline
Votorx
Senior Member
Join Date: Jun 2004
Old 10-07-2004 , 21:51  
Reply With Quote #8

1. Whenever you change a cvar num you need to restart the server.
2. Just type in sv_allowignore 1
__________________
Currently Looking for a mod team.
Votorx is offline
Send a message via AIM to Votorx Send a message via MSN to Votorx Send a message via Yahoo to Votorx
jackflack
Member
Join Date: Mar 2004
Location: Temecula, CA
Old 10-08-2004 , 00:57  
Reply With Quote #9

Quote:
Originally Posted by Votorx
1. Whenever you change a cvar num you need to restart the server.
2. Just type in sv_allowignore 1
Ok here is what i did.

1. Typed sv_allowignore 1 in console.
2. Typed amx_cvar sv_allowignore 1 got same error as before.
3. Quit server

After reboot tried again and it tells me that the server is not in ignore mode.

I must be doing something wrong still.

Sorry.

-jack
jackflack is offline
Kamikaze
Senior Member
Join Date: Mar 2004
Location: Butler, PA
Old 10-08-2004 , 00:59  
Reply With Quote #10

//// amx_changeimmune.sma
// Z:\HLSERVERUWC3\cstrike\addons\amxmodx\script ing\amx_changeimmune.sma(58) : w
arning 225: unreachable code
// Z:\HLSERVERUWC3\cstrike\addons\amxmodx\script ing\amx_changeimmune.sma(63) : w
arning 225: unreachable code
// Z:\HLSERVERUWC3\cstrike\addons\amxmodx\script ing\amx_changeimmune.sma(66) : w
arning 225: unreachable code
// Z:\HLSERVERUWC3\cstrike\addons\amxmodx\script ing\amx_changeimmune.sma(174) :
warning 225: unreachable code
//
// 4 Warnings.
// Done.
//
// Compilation Time: 5.91 sec
// ----------------------------------------

Compiling warning, it will still function I'm sure, I'll try it out.
Kamikaze is offline
Send a message via ICQ to Kamikaze Send a message via AIM to Kamikaze Send a message via MSN to Kamikaze Send a message via Yahoo to Kamikaze
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 00:41.


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