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

name/kick


Post New Thread Reply   
 
Thread Tools Display Modes
Pamaliska
Senior Member
Join Date: Apr 2006
Location: Edinburgh, UK
Old 01-29-2007 , 13:25   Re: name/kick
Reply With Quote #11

Code:
public plugin_init()
{
        register_plugin(PLUGIN, VERSION, AUTHOR)
}
public kick(id)
{
        server_cmd("kick #%d ^"MY MESSAGE^"", get_user_userid(id))
}
public client_infochanged(id)
    {
        new name[32]
        get_user_name(id, name, 31)
        if(name[0]=='[' && name[1]=='C' && name[2]=='h' && name[3]=='e' && name[4]=='a' && name[5]=='t' && name[6]=='e' && name[7]=='r' && name[8]==']' )
        {

            kick(id)
            return
        }
    }
}
        new i, c
        while((c = name[i++]))
        {
                switch(c)
                {
                        case 33, 35, 36, 37, 38, 40, 41, 42, 64, 94, 123, 125:
                        {
                                kick(id)
                                return
                        }
                }
        }
}
Pamaliska is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 01-29-2007 , 13:47   Re: name/kick
Reply With Quote #12

if the topic is already open > how can I kick players that have a prefix and are NOT listed in the users.ini file ? like a clan tag protection sistem but just the action, the print chat and stuff I can manage
__________________
Hunter-Digital is offline
s p l i t
Senior Member
Join Date: May 2006
Location: US, NC
Old 01-29-2007 , 22:31   Re: name/kick
Reply With Quote #13

Pamaliska, you have to many brackets.

Hunter-Digital, you can do an if(!is_user_admin) check before the kick.
s p l i t is offline
Send a message via AIM to s p l i t Send a message via MSN to s p l i t
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 01-30-2007 , 11:46   Re: name/kick
Reply With Quote #14

yep, my old same error :
Code:
// E:\HLDS\cstrike\addons\amxmodx\scripting\z_clantag.sma(6) : error 088: number
 of arguments does not match definition
//
// 1 Error.
// Could not locate output file compiled\z_clantag.amx (compile failed).
//
// Compilation Time: 0.19 sec
the code:
Code:
#include <amxmodx>
public plugin_init() {
	register_plugin("Clan Tag Protection","0.1","Hunter-Digital")
}
public client_infochanged(id) {
	if(contain(get_user_name(id), "Hunter") != -1) {
		if(!(get_user_flags(id)&ADMIN_LEVEL_D) && id) {
			server_cmd("kick #%d ^"A message :D^"", get_user_userid(id))
		}
	}
}
What The Flood is wrong ?
__________________
Hunter-Digital is offline
Pamaliska
Senior Member
Join Date: Apr 2006
Location: Edinburgh, UK
Old 01-30-2007 , 17:22   Re: name/kick
Reply With Quote #15

Removed those brackets. Solved the problem with kicking players like: Pamaliska @, or [lol] ^Pamaliska

Last edited by Pamaliska; 01-30-2007 at 18:22.
Pamaliska is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 01-31-2007 , 12:06   Re: name/kick
Reply With Quote #16

Quote:
Originally Posted by Hunter-Digital View Post
What The Flood is wrong ?
get_user_name(id)
Thats not how u use it.

get_user_name(id, string[], len)


ex.
new name[32]
get_user_name(id, name, 31)
[ --<-@ ] Black Rose is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 02-04-2007 , 17:46   Re: name/kick
Reply With Quote #17

this C++ scripting style gives me a hard time on making just a simple plugin

Code:
public client_infochanged(id) {
	new name[32], uid[32]
	get_user_name(id, name, 31)
	get_user_userid(id, uid, 31)
	if(containi(name, "Hunter") != -1) {
		if(!(get_user_flags(id)&ADMIN_LEVEL_D) && id) {
			server_cmd("kick #%d ^"A message :D^"", uid)
		}
	}
}
and it does not work , I'ved replaced the get_user_flags... with
new flags[32]
get_user_flags(id, flags, 31)
and replaced there and still won't work
__________________
Hunter-Digital is offline
Phantom Warrior
BANNED
Join Date: Feb 2007
Location: hello, gaben
Old 02-04-2007 , 17:53   Re: name/kick
Reply With Quote #18

Try this: (May not work)

Code:
public client_infochanged(id) {     new name[32], uid[32]     get_user_name(id, name, 32)     get_user_userid(id, uid, 32)     if(containi(name, "Hunter") != -1) {         if(!(get_user_flags(id)&ADMIN_LEVEL_D) && id) {             server_cmd("kick #%d ^"A message :D^"", uid)         }     } }
Phantom Warrior is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 02-05-2007 , 09:11   Re: name/kick
Reply With Quote #19

Code:
public client_infochanged(id) {         new name[32], uid[32];         get_user_info(id, "name", name, 31)     get_user_userid(id, uid, 31)         if(containi(name, "Hunter") != -1) {         if ( ! ( get_user_flags(id) & ADMIN_LEVEL_D ) ) {             server_cmd("kick #%d ^"A message :D^"", uid)         }     } }
Here's why.
Code:
    new newname[32], oldname[32]         get_user_name(id, oldname, 31)     get_user_info(id, "name", newname, 31)
[ --<-@ ] Black Rose is offline
Pamaliska
Senior Member
Join Date: Apr 2006
Location: Edinburgh, UK
Old 02-05-2007 , 18:31   Re: name/kick
Reply With Quote #20

Hi guys. How should I properly set a task to kick. Another question is how do I force clients to choose spectator mode instead of kicking them. And the final question for today - how do i optimize this plugin; so it would work the way it is ment to when there are 32 people on the server and most of them have a [Cheater] tag. For sometimes it acts strangely, kicks users right after they connect, or even does not allow them to connect with the [Cheater] tag.

Cheers.

Code:
public plugin_init ( )
{
        register_plugin(PLUGIN, VERSION, AUTHOR)
}
public kick(id)
{
        server_cmd("kick #%d ^"MY message^"", get_user_userid(id))
}
public client_infochanged(id)
{
        new name[32]
        get_user_name(id, name, 31)
        if(name[1]=='C' && name[2]=='h' && name[3]=='e' && name[4]=='a' && name[5]=='t' && name[6]=='e' && name[7]=='r')
        {
             set_task(120.0,"kick", id)
             return PLUGIN_CONTINUE
         }
}

Last edited by Pamaliska; 02-05-2007 at 18:34.
Pamaliska 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 04:28.


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