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

Spec Kick 1.0


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Server Management        Approver:   Johnny got his gun (102)
foo.bar
Junior Member
Join Date: Sep 2004
Location: SJCampos - Brazil
Old 09-16-2004 , 09:00   Spec Kick 1.0
Reply With Quote #1

- Spec Kick 1.0
by foo.bar ([email protected])

- Description:
Kicks all spectators, except players with the immunity tag, on round start. This plugin is Steam Counter-strike 1.6 specific.

- Motivations:
I run a very popular CS server and folks that connect don't like to leave the server whenever they go out for dinner, take a shower or go to sleep (yes, I've really had players going to bed when they went into spectator mode). I whipped up this script to keep those asshats off the server.


- Usage:
1. If you want, edit the MIN_PLAYERS to set the minimum number of players on the server before it starts checking for spectators.
2. Compile.
3. Plug into the the plugin.ini file.
4. There is no step 4
5. Finnish!

- Possible future additions:
Interface with a database to keep track of repeat offenders
Ban repeat offeners for a few minutes to teach them a lesson
Code optimizations?

- Acknowledgments:
Freecode, thanks for the help with debugging the code

For those of you that like to browse code...
Code:
#include <amxmodx> #include <cstrike> #define MIN_PLAYERS 9 public Round_Time() {         new Float:roundtime = get_cvar_float("mp_roundtime") * 60.0         new rtime = read_data(1)         if ( roundtime == rtime )   {                 new playerCount = get_playersnum()                 if (playerCount > MIN_PLAYERS) {                         new Players[32]                         get_players(Players, playerCount)                         for (new i = 0; i < playerCount; i++) {                                if (is_user_connected(Players[i])) {                                        if (!(get_user_flags(Players[i]) & ADMIN_IMMUNITY)) {                                                 if ((cs_get_user_team(Players[i]) == 3)) {                                                         new name[32], authid[32]                                                         get_user_name(Players[i],name,31)                                                         get_user_authid(Players[i],authid,31)                                                         new userid = get_user_userid(Players[i])                                                         server_cmd("kick #%d ^"Spectators aren't welcome on this server.^"",userid)                                                         log_amx("Spec Kick: ^"%s<%d><%s>^" was spec kicked)", name,userid,authid)                                                 }                                         }                                 }                         }                 }         }         return PLUGIN_CONTINUE } public plugin_init() {         register_plugin("Spec Kick","1.0","foo.bar")         register_event("RoundTime", "Round_Time", "bc")         return PLUGIN_CONTINUE }
Attached Files
File Type: zip spec_kick.zip (2.0 KB, 7557 views)
File Type: sma Get Plugin or Get Source (spec_kick.sma - 10465 views - 2.1 KB)
__________________
Wenn ist das Nunstuck git und Slotermeyer?
Ja! Beiherhund das Oder die Flipperwaldt gersput!
foo.bar is offline
ancient1
Senior Member
Join Date: Jul 2004
Location: UK
Old 09-16-2004 , 09:25  
Reply With Quote #2

I dont really see the point of this plugin as a AFK kick plugin of which there are numerous do just the same job you want?

Banning spectators from the the same IP may be usefull so players in Internet Cafe's cant tell their friends the location of the enemy etc might be of use, but I just dont see this as usefull TBH, sorry....

Ancient
__________________
ancient1 is offline
foo.bar
Junior Member
Join Date: Sep 2004
Location: SJCampos - Brazil
Old 09-16-2004 , 09:33  
Reply With Quote #3

Quote:
Originally Posted by ancient1
I dont really see the point of this plugin as a AFK kick plugin of which there are numerous do just the same job you want?
Actually, in my case, they aren't. AFK plugins never kick the spectators from my server and I've installed quite a few of them. I dunno if I've configured the AFK plugins (or my server) incorrectly but it runs so smooth (i.e. I'm afraid to mess the server up) and I was bored so I just wrote my own little tool for my own necessity.

Quote:
Originally Posted by ancient1
Banning spectators from the the same IP may be usefull so players in Internet Cafe's cant tell their friends the location of the enemy etc might be of use, but I just dont see this as usefull TBH, sorry....
My server isn't a lanhouse server, it's an internet server so banning, if I really do implement temporary banning, would be based on STEAM_IDs. I know I have many repeat offenders for going into spec and sitting there until they're ready to play and if I really do implement banning, it would be for short periods so that they don't just reconnect and start playing again like nothing happened.
__________________
Wenn ist das Nunstuck git und Slotermeyer?
Ja! Beiherhund das Oder die Flipperwaldt gersput!
foo.bar is offline
ancient1
Senior Member
Join Date: Jul 2004
Location: UK
Old 09-16-2004 , 10:06  
Reply With Quote #4

In your server.cfg set

allow_spectators 0

That may help you?

Ancient
__________________
ancient1 is offline
BigBaller
Veteran Member
Join Date: Mar 2004
Location: Everett, WA
Old 09-16-2004 , 10:09  
Reply With Quote #5

I like the concept of this plugin, I requested something like this a while back.

I dont mind some spectators however some spectators just leave themselfs in the game at spec for over 5 mins it kinda pisses people off. That is one took up spot on the server.

foo.bar this will kick spectators after a certian ammount of time?

Also, you dont need to provide the source in the post nor a zip with both compiled and source. All you have to do is post the .sma ... the online compiler will do the rest if people just want the plugin and if others want the source they can download it. Just a tip ;d
__________________

BigBaller is offline
Johnny got his gun
Veteran Member
Join Date: Jan 2004
Location: Tokyo
Old 09-16-2004 , 10:13  
Reply With Quote #6

Did you see how fast his plugin got approved just because I didn't have to download a file, open it and then look through it?
Johnny got his gun is offline
BigBaller
Veteran Member
Join Date: Mar 2004
Location: Everett, WA
Old 09-16-2004 , 10:20  
Reply With Quote #7

haha JGHG. you got a good point
__________________

BigBaller is offline
foo.bar
Junior Member
Join Date: Sep 2004
Location: SJCampos - Brazil
Old 09-16-2004 , 10:58  
Reply With Quote #8

Quote:
Originally Posted by ancient1
In your server.cfg set

allow_spectators 0
I did try that but I still want to leave open the possibility for an admin to sit in spec and observe possible abusers.
__________________
Wenn ist das Nunstuck git und Slotermeyer?
Ja! Beiherhund das Oder die Flipperwaldt gersput!
foo.bar is offline
foo.bar
Junior Member
Join Date: Sep 2004
Location: SJCampos - Brazil
Old 09-16-2004 , 10:59  
Reply With Quote #9

Quote:
Originally Posted by Johnny got his gun
Did you see how fast his plugin got approved just because I didn't have to download a file, open it and then look through it?
Don't forget to mention that I read the sticky posts.
__________________
Wenn ist das Nunstuck git und Slotermeyer?
Ja! Beiherhund das Oder die Flipperwaldt gersput!
foo.bar is offline
Rastin
Member
Join Date: Jun 2004
Old 09-16-2004 , 11:48  
Reply With Quote #10

Ive been looking for a plugin like this for awhile now cause I also have the same problem of people going into spectate for too long. Does this kick them right away if they go into spectate? or is there a time limit you can set? And you say 1.6 specific, will it work for CZ?
__________________
Rastin 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 00:56.


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