AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   Spec Kick 1.0 (https://forums.alliedmods.net/showthread.php?t=5912)

foo.bar 09-16-2004 09:00

Spec Kick 1.0
 
2 Attachment(s)
- 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 }

ancient1 09-16-2004 09:25

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 :?

foo.bar 09-16-2004 09:33

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.

ancient1 09-16-2004 10:06

In your server.cfg set

allow_spectators 0

That may help you?

Ancient

BigBaller 09-16-2004 10:09

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

Johnny got his gun 09-16-2004 10:13

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? :up:

BigBaller 09-16-2004 10:20

haha JGHG. you got a good point :D

foo.bar 09-16-2004 10:58

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.

foo.bar 09-16-2004 10:59

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? :up:

Don't forget to mention that I read the sticky posts. :)

Rastin 09-16-2004 11:48

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?


All times are GMT -4. The time now is 08:12.

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