EventScripts Forums
Mattie's EventScripts and Source Forums
Mattie recommends...
Premier Sponsor:Platinum Sponsor:
 
Script Categories
addon (49) admin (269) admins (14) advert (15) adverts (19) afk (15) alerts (12) ammo (23) anti (15) auth (16) automatic (12) awp (23) ban (18) ba_jail (17) bhop (19) block (19) bomb (40) bonus (23) bot (24) bot-management (19) bots (17) bunnyhop (11) Buy (21) cash (65) chat (57) cheat (11) clan (16) classes (22) color (21) colors (18) command (20) commands (18) config (22) connect (42) CS:S (16) css (2507) Damage (35) database (11) dead (15) death (19) deathmatch (70) deathrun (12) disconnect (18) Dissolve (11) dm (20) dod:s (11) dods (389) easy (17) effects (120) English (15) entity (21) es_tools (12) Eventscript (12) flashbang (25) français (99) french (36) fun (288) funny (16) Gabeee (11) gameplay (174) give (16) gravity (11) grenade (25) grenades (29) gun (14) GunGame (26) GunGame5 (11) guns (17) Hack (15) headshot (32) health (55) hegrenade (13) hl2dm (332) HP (13) info (48) information (16) jail (26) jailbreak (11) join (23) jump (12) kick (23) kill (44) kills (22) knife (57) leveling (36) management (14) mani (15) map (25) map-management (27) maps (15) match (17) menu (106) message (20) messaging (52) mod (109) model (14) models (32) money (42) motd (13) music (29) mute (18) nades (18) name (13) noblock (35) player (40) player-management (31) player-tracking (28) popup (56) props (23) protection (27) punishment (50) python (63) quake (18) radio (21) random (36) rank (35) rates (16) rcon (13) realism (21) respawn (61) restrict (36) round (20) rpg (24) rules (42) say (11) scout (19) Script (20) script-helper (25) scriptpack (33) sdk (151) server (44) server-tools (42) shop (12) silly (31) simple (27) skins (25) slay (13) soccer (11) sound (45) sounds (92) spawn (63) speed (25) statistics (13) stats (48) STEAMID (23) Superhero (13) surf (31) Team (25) team-balance (14) teleport (12) text (14) TF2 (143) time (17) timer (14) tools (15) tracers (17) triggers (11) uedi (18) uses_auth (18) utility (11) vip (12) vote (36) voting (22) war (20) wcs (24) wcs:Python (32) weapon (77) weapons (114) web (14) welcome (12) zm (24) zombie (90) zombiemod (51) zombies (11)
Script Authors
*XYZ*SaYnt (12) .:MiB:. (11) .eMko* (6) 101satoon101 (10) 3R10N (24) 4u571n91 (5) 7355608 (9) Absolute (8) Ace Rimmer (40) adminc (5) Adz (8) AgathaKnuppelkuh (8) aidden (8) ajax (5) ak_47 (6) Al3c Tr3v3lyan (6) allstareng (5) ashbash1987 (9) ATAMAH (7) aznone (5) B00M (5) BackRaw (41) BFH_RedBull (8) bigfabi (7) Bioko (7) Blade (10) bladesback (13) bobdole (11) bodzsar1 (8) bonbon (36) Brainsucker (30) cagemonkey (8) carbon-14 (10) CaskioUTF (5) cbirou (15) ChaCaLz2psy4 (5) CharlesT (5) Chrisber (5) chrismrulz (9) Chun (6) cladiron (10) clipz934 (8) Colster (21) Cookieman8 (7) craziest (10) DanielB (19) Darkness123 (8) Dave (9) dbozan99 (7) deathx9 (5) Deathyy (16) dhack (16) Di[M]aN (12) DoCky (27) Don (15) dordtcore (8) DragonFreddo (8) Drassil (5) Einlanzers (42) EmbouT (10) emilplov (7) Errant (10) Eun (6) Fantole (9) Franc1sco (9) freddukes (18) Frequency (6) Fulmine (5) GAMEREN2 (8) german9114 (13) GODJonez (38) GoodfellaDeal (5) Hansi (6) HitThePipe (7) HOLLDIDAY (9) Icetouch (6) ichthys (25) infamous1 (9) Jeff91 (45) JoeyT2006 (30) Juba_PornBorn (12) jxl180 (10) KDBFame (6) L'In20Cible (7) Largo Usagi (10) Lobe (11) loKkdoKk (7) lolo-le-haricot (7) LosNir (5) Lumpi@Work (9) M4rc3L-XCN (7) macshot (6) Matth (6) Mattie (20) MBchrono (15) McFly (20) Medda (5) Memphis-84 (10) Messiah93 (12) Mickyy (5) micmacx (6) Mitchell (5) Mordavolt (7) MrScriptaz (5) mryoung (6) Nicolous (26) ojii (31) Omega_K2 (8) Owned|Myself (8) P3N (7) pand3mic (5) parsimba (5) Pascal257 (9) PatPeter (7) PDrop (10) Phaedrus (18) PhantOm Fury (7) phoenix131 (9) pinkyyy -.- (5) pitbull0993 (7) randomknifer (9) Ratzee (6) ReaCtioN2oo9 (6) Rennnyyy (17) revolutionfighters (6) RideGuy (12) Rio (9) Roeliekt (6) runamagic (13) sandking220 (6) Sarcasm_Poisoning (10) saRs| Johnny-5 (13) Schubaal (10) sea212 (5) sega74rus (7) sgt.angel (6) sicilia (5) sicman_adrian (22) skillz92 (7) sn4k3 (18) snake38 (10) sonicsight (7) spoonman184 (8) stabby (22) stas (22) Strontium Dog (30) SumGuy14 (25) SuperDave (45) surfteam (5) TaCo (5) TanaToS (17) Tealk (6) teowow (16) TheCheeTaH (20) TheDonFather (5) theresthatguy (6) Tiny Tod (7) Totyahun (9) uedi (38) Undead (25) usernamesaretaken (15) Warren (13) westham (6) WhiteAvenger (7) Wonder (14) X-Mania (5) XE_ManUp (13) xfalcon61 (5) zSweetXz (5) [Cs]Lord_Inferno2 (11) [NATO]Hunter (28) ||Wolf|| (10)
Search

Post new topic Reply to topic
Author Message
User avatar
EventScripts Administrator
EventScripts Administrator
Profile

Posts: 3479
Location:
Calgary, Waterloo, Ottawa
 
New postPosted: 2006-05-14, 11:38 pm 
   Post subject: [es1.0+] Spectator Kicker v3.2

Spectator Kicker v3.2

note: If you run a DM server you should use the version here

Features:
    Kicks players that spectate for a set number of rounds
    Admin immunity. Admin list part of script

Install:
    Put the supplied code into addons/eventscripts/spectate_kick/es_spectate_kick.txt
    add es_load spectate_kick
    to autoexec.cfg
    restart server


Settings:
Code:
spec_kick_enable 1 //enable or disable spectate kick
spec_rounds 2 //Number of rounds before a spectator is kicked. 1 = They will be kicked the very first round they spectate
spec_admin_immune 1 //Enable admin immunity
spec_reset 1 //1 = Reset spectate count when player joins a team. 0 = Count only resets when player reconnects to server
spec_kick_reason "spectator for too many rounds"
spec_min_players 0 //set this to the minimum number of players before the spectator kicker will be activated

es_xkeycreate spec_kick_admins "steam_0:0:5333515"
   //Remove the comment //'s below and add your own admins steamid like the one above
   //es_xkeycreate spec_kick_admins "steam_0:0:xxxxxxx"
   //es_xkeycreate spec_kick_admins "steam_0:0:xxxxxxx"
   //es_xkeycreate spec_kick_admins "steam_0:0:xxxxxxx"



cstrike/addons/eventscripts/spectate_kick/es_spectate_kick.txt
ES:
    //Spectate Kicker v3.2 by ichthys

    //for Mattie's Eventscripts v.1.0  <!-- m --><a class="postlink" href="http://mattie.info/cs/">http://mattie.info/cs/</a><!-- m -->



    //v3.1 Thanks to cagemonkey for pointing out and fixing bugs for me



    block config

    {

            spec_kick_enable 1 //enable or disable spectate kick

            spec_rounds 2 //Number of rounds before a spectator is kicked. 1 = They will be kicked the very first round they spectate

            spec_admin_immune 0 //Enable admin immunity

            spec_reset 1 //1 = reset spectate count when player joins a team. 0 = Count only resets when player reconnects to server

            spec_kick_reason "spectator for too many rounds"

            spec_min_players 16 //set this to the minimum number of players before the spectator kicker will be activated

           

            es_xkeycreate spec_kick_admins "steam_0:0:5333515"

            //Remove the comment //'s below and add your own admins steamid like the one above

            //es_xkeycreate spec_kick_admins "steam_0:0:xxxxxxx"

            //es_xkeycreate spec_kick_admins "steam_0:0:xxxxxxx"

            //es_xkeycreate spec_kick_admins "steam_0:0:xxxxxxx"

           

    }



    block load

    {

            //initialize variables es_x

            es_xsetinfo spec_kick_enable 0

            es_xsetinfo spec_rounds 0

            es_xsetinfo spec_admin_immune 0

            es_xsetinfo spec_reset 0

            es_xsetinfo spec_kick_reason 0

            es_xsetinfo spec_min_players 0

            es_xsetinfo spec_dead 0

            es_xsetinfo spec_team 0

            es_xsetinfo spec_kick_version "3.2"

            es_xmakepublic spec_kick_version



            es_xsetinfo spec_count 0



            es_xkeygroupcreate spec_kick

            es_xkeygroupcreate spec_kick_admins

            es_xdoblock spectate_kick/config

            es es_xformat spec_count "es kickid event_var(userid) %1" server_var(spec_kick_reason)

            es alias alias_spec_kick server_var(spec_count)

    }



    block spec_spawn

    {

            es es_xkeygetvalue spec_dead spec_kick_temp server_var(spec_key) isdead

            es es_xif (server_var(spec_dead) = 1) do

            {

                    es es_xkeygetvalue spec_team spec_kick_temp server_var(spec_key) teamid

                    es es_xif (server_var(spec_team) < 2) do

                    {

                            es_xsetinfo spec_admin 0

                            es es_xif (server_var(spec_admin_immune) equalto 1) do

                            {

                                    es es_xgetplayersteamid spec_steamid server_var(spec_key)

                                    es es_xexists spec_admin key spec_kick_admins server_var(spec_steamid)

                            }

                           

                            es es_xif (server_var(spec_admin) equalto 0) do

                            {

                                    es es_xkeycreate spec_kick server_var(spec_key)

                                    es es_xkeygetvalue spec_count spec_kick server_var(spec_key) count

                                    es_xmath spec_count + 1

                                    es es_xkeysetvalue spec_kick server_var(spec_key) count server_var(spec_count)

                                    es es_xtell server_var(spec_key) #multi #lightgreenichthys' specator kicker::#green server_var(spec_count) #defaultof#green server_var(spec_rounds)

                                    es es_xif (server_var(spec_count) >= server_var(spec_rounds)) then alias_spec_kick

                            }

                    }

            }

    }



    event round_end

    {

            es es_xif (server_var(spec_kick_enable) equalto 1) do

            {

                    es_xsetinfo spec_playercount 0

                    es_xgetplayercount spec_playercount

                    es es_xif (server_var(spec_playercount) >= server_var(spec_min_players)) do

                    {

                            es_xcreateplayerlist spec_kick_temp

                            es_xforeachkey spec_key in spec_kick_temp "es_xdoblock spectate_kick/spec_spawn"

                            es_xkeygroupdelete spec_kick_temp

                    }

            }

    }



    event player_team

    {

            es es_xif (event_var(disconnect) equalto 0) then es_xif (event_var(team) greaterthan 1) then es_xif (server_var(spec_reset) equalto 1) then es_xkeysetvalue spec_kick event_var(userid) count 0

    }



    event player_connect

    {

            es es_xkeycreate spec_kick event_var(userid)

            es es_xkeysetvalue spec_kick event_var(userid) count 0

            es es_xkeysetvalue spec_kick event_var(userid) dead 1

    }



    event player_disconnect

    {

            es es_xkeydelete spec_kick event_var(userid)

    }



    event player_death

    {

            es es_xkeysetvalue spec_kick event_var(userid) dead 1

    }



    event player_spawn

    {

            es es_xif (event_var(es es_xuserteam) > 1) then es_xkeysetvalue spec_kick event_var(userid) dead 0

    }



    block unload

    {

            es_xkeygroupdelete spec_kick

            es_xkeygroupdelete spec_kick_admins

    }

update 2.1
Added
spec_min_players 0 //set this to the minimum number of players before the spectator kicker will be activated

updated 2.2
Missed creation of spec_dead variable

update 3.0
No longer uses es_cexec_all

update 3.1
Quick fix to update some code I forgot up update in 3.0
Wonder version..... :roll:
Added Admin internally since UA is way too oldschool

Update 3.2
My Wonder find and replace method didn't work too well and caused problems in 3.1 Whoops. Fixed in this version

_________________
Image
Image


Last edited by ichthys on 2006-12-10, 9:52 am, edited 11 times in total.




User avatar
Experienced
Profile

Posts: 423
 
New postPosted: 2006-05-15, 11:58 am 

thx a lot!!! was waiting for this one sooo baaadly

_________________
afk


User avatar
EventScripts Administrator
EventScripts Administrator
Profile

Posts: 3479
Location:
Calgary, Waterloo, Ottawa
 
New postPosted: 2006-05-15, 1:59 pm 

:)

_________________
Image
Image


User avatar
New User
Profile

Posts: 9
 
New postPosted: 2006-05-31, 4:09 am 

Hi Ichtys

Nice script mate, is it possible to add a feature to the script, so it only kicks spectators if server is full ?

i dont mind peeps spectating if the server aint full, it makes the server look more populated, but can be anoying if the server is full with 26 slots, and 7 peeps are spectating.

That would make this script even nicer :D

Regards


Xeen


User avatar
EventScripts Administrator
EventScripts Administrator
Profile

Posts: 3479
Location:
Calgary, Waterloo, Ottawa
 
New postPosted: 2006-06-06, 10:37 am 

Done

Added

spec_min_players 0 //set this to the minimum number of players before the spectator kicker will be activated

_________________
Image
Image


User avatar
New User
Profile

Posts: 9
 
New postPosted: 2006-06-07, 1:01 pm 

Thanks alot mate :D


User avatar
Newbie
Profile

Posts: 37
 
New postPosted: 2006-11-01, 2:44 am 

hi i seem to have a issue
seems if client goes to spectate immediately after joining
the server spectator kicks is not enabled for them but if
they start playing then go to spectator it works fine

I'm running gungame not sure if that has something to do with it


User avatar
EventScripts Administrator
EventScripts Administrator
Profile

Posts: 3479
Location:
Calgary, Waterloo, Ottawa
 
New postPosted: 2006-11-01, 5:30 pm 

RabidRat wrote:
hi i seem to have a issue
seems if client goes to spectate immediately after joining
the server spectator kicks is not enabled for them but if
they start playing then go to spectator it works fine

I'm running gungame not sure if that has something to do with it


Do they actually select spectate or do they just not choose a team? This is quite strange. Maybe es_cexec_all doesn't work on some players... If thats the case i'm sure es_createplayerlist will work. I'll see if I can reproduce this and have a fix ready for you.

edit: lol I know whats wrong. 1 sec

_________________
Image
Image


Last edited by ichthys on 2006-11-01, 6:04 pm, edited 1 time in total.

User avatar
EventScripts Administrator
EventScripts Administrator
Profile

Posts: 3479
Location:
Calgary, Waterloo, Ottawa
 
New postPosted: 2006-11-01, 6:12 pm 

Get v2.3

_________________
Image
Image


User avatar
Newbie
Profile

Posts: 37
 
New postPosted: 2006-11-01, 11:10 pm 

great thx a bunch
will this work they do not choose a team aswell?


User avatar
EventScripts Administrator
EventScripts Administrator
Profile

Posts: 3479
Location:
Calgary, Waterloo, Ottawa
 
New postPosted: 2006-11-01, 11:18 pm 

Yes. Basically the script was not setting players as dead until they actually died! Not before they even spawn for the first time!

_________________
Image
Image


User avatar
Newbie
Profile

Posts: 37
 
New postPosted: 2006-11-01, 11:21 pm 

sweet thx again


User avatar
Professor
Professor
Profile

Posts: 1992
Location:
127.0.0.1
 
New postPosted: 2006-12-06, 7:05 pm 

Do you plan on updating this so it will work after the Nov Steam update that blocks es_cexec?

_________________
Cagemonkey I [GunGame] 4 Join now!
ninja monkeys are meeting as we speak, plotting my demise
Image


User avatar
EventScripts Administrator
EventScripts Administrator
Profile

Posts: 3479
Location:
Calgary, Waterloo, Ottawa
 
New postPosted: 2006-12-06, 10:47 pm 

cagemonkey wrote:
Do you plan on updating this so it will work after the Nov Steam update that blocks es_cexec?


I do now....... :P


edit: done

edit2: poopy some little bugs. Thanks again cagemonkey
update very soon.

_________________
Image
Image


User avatar
EventScripts Administrator
EventScripts Administrator
Profile

Posts: 3479
Location:
Calgary, Waterloo, Ottawa
 
New postPosted: 2006-12-09, 9:46 am 

some more fixes in 3.2

_________________
Image
Image


User avatar
Helper
Profile

Posts: 245
Location:
Tourcoing (Nord - 59)
 
New postPosted: 2007-09-04, 9:56 am 

Hi :)

I've a probleme with this script.
This is my config :
ES:
    block config

    {

            spec_kick_enable 1 //enable or disable spectate kick

            spec_rounds 2 //Number of rounds before a spectator is kicked. 1 = They will be kicked the very first round they spectate

            spec_admin_immune 0 //Enable admin immunity

            spec_reset 1 //1 = reset spectate count when player joins a team. 0 = Count only resets when player reconnects to server

            spec_kick_reason "spectator for too many rounds"

            spec_min_players 4 //set this to the minimum number of players before the spectator kicker will be activated

           

            es_xkeycreate spec_kick_admins "steam_0:0:5333515"

            //Remove the comment //'s below and add your own admins steamid like the one above

            //es_xkeycreate spec_kick_admins "steam_0:0:xxxxxxx"

            //es_xkeycreate spec_kick_admins "steam_0:0:xxxxxxx"

            //es_xkeycreate spec_kick_admins "steam_0:0:xxxxxxx"

           

    }

     

If i'm spectator, i see in the chat :
ichthys ' specator kicker : : 1 of 2
ichthys ' specator kicker : : 2 of 2
ichthys ' specator kicker : : 3 of 2
ichthys ' specator kicker : : 4 of 2
etc...etc...
And i never be kicked :-/

You know this problem ?

Sorry for my englsh (french inside ^^)

EDIT :
ES:
    ParseCommand: Error in string format.

      Error source es_spectate_kick.txt: es es_xif (event_var(es es_xuserteam) > 1) then es_xkeysetvalue spec_kick event_var(userid) dead 0

    Error, bad server command es_xif (  (InsertServerCommand)

    ParseCommand: Error in string format.

      Error source es_spectate_kick.txt: es es_xif (event_var(es es_xuserteam) > 1) then es_xkeysetvalue spec_kick event_var(userid) dead 0

    Error, bad server command es_xif (  (InsertServerCommand)

    ParseCommand: Error in string format.

      Error source es_spectate_kick.txt: es es_xif (event_var(es es_xuserteam) > 1) then es_xkeysetvalue spec_kick event_var(userid) dead 0

    Error, bad server command es_xif (  (InsertServerCommand)

    ParseCommand: Error in string format.

      Error source es_spectate_kick.txt: es es_xif (event_var(es es_xuserteam) > 1) then es_xkeysetvalue spec_kick event_var(userid) dead 0

    Error, bad server command es_xif (  (InsertServerCommand)

    ParseCommand: Error in string format.

      Error source es_spectate_kick.txt: es es_xif (event_var(es es_xuserteam) > 1) then es_xkeysetvalue spec_kick event_var(userid) dead 0

    Error, bad server command es_xif (  (InsertServerCommand)

    ParseCommand: Error in string format.

      Error source es_spectate_kick.txt: es es_xif (event_var(es es_xuserteam) > 1) then es_xkeysetvalue spec_kick event_var(userid) dead 0

    Error, bad server command es_xif (  (InsertServerCommand)

     

- l0l0 -

_________________
L'enfer étais complet, alors je suis revenu
Image
Image


User avatar
Guru
Guru
Profile

Posts: 1334
Location:
UK, Essex
 
New postPosted: 2007-09-04, 7:04 pm 

es_if is not a command in eventscripts, this one needs updating :)

_________________
PMA | Predator^
_________________

http://pred.yardimage.co.uk
_________________

Image


User avatar
Guru
Guru
Profile

Posts: 1384
Location:
last house on the left
 
New postPosted: 2007-09-04, 8:12 pm 

TP.Pred wrote:
es_if is not a command in eventscripts, this one needs updating :)

"es es_xif " in earlier versions of ES did work. Putting 'es' in front of es_x* commands that needed to expand vars was quicker than using es_*... supposedly :roll: ... there'd been a long running debate about it's usage.

Not sure if it still works under 1.5, I'll have to check... I think I did that with one of my scripts... :o


-Hit


Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 22 posts ]  Go to page 1, 2  Next


Who is online

Users browsing this forum: coty944 and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group