Raised This Month: $32 Target: $400
 8% 

Spec_Kick ( Need Some Changes )


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Abdulrazzaq
Member
Join Date: Oct 2019
Location: NZ
Old 08-08-2020 , 05:32   Spec_Kick ( Need Some Changes )
Reply With Quote #1

HI Guyz i Saw A Plugin With Name Spec_kick It was all perfect i love that plugin
but the only thing i want to change in it will kick admins too

I have a clan war server ...some team player join spec sometimes to check other teams or some
of my admins help other teams ...so i don't want anyone to spec for longer time ....
i know the cmds but i want changes in this plugin

i know these cmds too but we need spec sometimes
mp_autokick 1
allow_spectators 1

so i want someone to add cmd of admin flags please
i don't know about coding
or give cmd to kick all .....like this

Code:
/* 

- 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
Version 1.1 --> Enhanced by Genesis
*/

#include <amxmodx>
#include <amxmisc>

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 > get_cvar_num("amx_specminplayers")) 
        {
	   new Players[32]
	   get_players(Players, playerCount) 
	   for (new i = 0; i < playerCount; i++) 
	   {
            	if (is_user_connected(Players[i])) 
		{
                   if (!is_user_admin(Players[i])) 
		   {
			if(!is_user_hltv(Players[i]))
			{
			   if ((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.1","foo.bar")
	register_event("RoundTime", "Round_Time", "bc")
	register_cvar("amx_specminplayers", "9")
        return PLUGIN_CONTINUE
}
Abdulrazzaq is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 08-08-2020 , 12:51   Re: Spec_Kick ( Need Some Changes )
Reply With Quote #2

Quote:
Originally Posted by Abdulrazzaq View Post
HI Guyz i Saw A Plugin With Name Spec_kick It was all perfect i love that plugin
but the only thing i want to change in it will kick admins too

I have a clan war server ...some team player join spec sometimes to check other teams or some
of my admins help other teams ...so i don't want anyone to spec for longer time ....
i know the cmds but i want changes in this plugin

i know these cmds too but we need spec sometimes
mp_autokick 1
allow_spectators 1

so i want someone to add cmd of admin flags please
i don't know about coding
or give cmd to kick all .....like this

Code:
/* 

- 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
Version 1.1 --> Enhanced by Genesis
*/

#include <amxmodx>
#include <amxmisc>

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 > get_cvar_num("amx_specminplayers")) 
        {
	   new Players[32]
	   get_players(Players, playerCount) 
	   for (new i = 0; i < playerCount; i++) 
	   {
            	if (is_user_connected(Players[i])) 
		{
                   if (!is_user_admin(Players[i])) 
		   {
			if(!is_user_hltv(Players[i]))
			{
			   if ((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.1","foo.bar")
	register_event("RoundTime", "Round_Time", "bc")
	register_cvar("amx_specminplayers", "9")
        return PLUGIN_CONTINUE
}
Add this code in round_time section
PHP Code:
if(is_user_admin(id))
    {
        return 
PLUGIN_CONTINUE;
    } 

Last edited by Supremache; 08-08-2020 at 13:28.
Supremache is offline
Abdulrazzaq
Member
Join Date: Oct 2019
Location: NZ
Old 08-10-2020 , 01:21   Re: Spec_Kick ( Need Some Changes )
Reply With Quote #3

Quote:
Originally Posted by Supremache View Post
Add this code in round_time section
PHP Code:
if(is_user_admin(id))
    {
        return 
PLUGIN_CONTINUE;
    } 
Explain Little bit more please it gives error ....where i have to add ?

Last edited by Abdulrazzaq; 08-10-2020 at 01:24.
Abdulrazzaq is offline
ZaX
Senior Member
Join Date: Jan 2015
Old 08-10-2020 , 01:42   Re: Spec_Kick ( Need Some Changes )
Reply With Quote #4

PHP Code:
/* 

- 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
Version 1.1 --> Enhanced by Genesis
*/

#include <amxmodx>
#include <amxmisc>

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 get_cvar_num("amx_specminplayers")) 
        {
            new 
Players[32]
            
get_players(PlayersplayerCount

            for (new 
0playerCounti++) 
            {
                if(
is_user_connected(Players[i])) 
                {
                    if(!
is_user_hltv(Players[i]))
                    {
                        if ((
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.1","foo.bar")
    register_event("RoundTime", "Round_Time", "bc")
    register_cvar("amx_specminplayers", "9")
        return PLUGIN_CONTINUE

ZaX is offline
Abdulrazzaq
Member
Join Date: Oct 2019
Location: NZ
Old 08-10-2020 , 01:49   Re: Spec_Kick ( Need Some Changes )
Reply With Quote #5

Quote:
Originally Posted by ZaX View Post
PHP Code:
/* 

- 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
Version 1.1 --> Enhanced by Genesis
*/

#include <amxmodx>
#include <amxmisc>

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 get_cvar_num("amx_specminplayers")) 
        {
            new 
Players[32]
            
get_players(PlayersplayerCount

            for (new 
0playerCounti++) 
            {
                if(
is_user_connected(Players[i])) 
                {
                    if(!
is_user_hltv(Players[i]))
                    {
                        if ((
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.1","foo.bar")
    register_event("RoundTime", "Round_Time", "bc")
    register_cvar("amx_specminplayers", "9")
        return PLUGIN_CONTINUE


Thanks a lot sir
but it gives 1 warning is it ok ? means it won't bug in server

Last edited by Abdulrazzaq; 08-10-2020 at 01:50.
Abdulrazzaq is offline
NOVA GAMING
Member
Join Date: Apr 2020
Old 08-10-2020 , 04:08   Re: Spec_Kick ( Need Some Changes )
Reply With Quote #6

Quote:
Originally Posted by Abdulrazzaq View Post

Thanks a lot sir
but it gives 1 warning is it ok ? means it won't bug in server
No it will not , Just a loose indentation warning in return PLUGIN_CONTINUE
__________________
NOVA GAMING 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 23:10.


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