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

name/kick


Post New Thread Reply   
 
Thread Tools Display Modes
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 02-06-2007 , 02:20   Re: name/kick
Reply With Quote #21

Plz die? I just told you how to check the name.

Your code is unreliable. A player changes his name, his id is 4 and his name is Cheater, the task is started. Now if this id is kicked or leaves, the task will remain. Someone else joins and get id 4, the task will execute after 120 seconds and kick this new player for no reason at all.

Last edited by [ --<-@ ] Black Rose; 02-06-2007 at 02:27.
[ --<-@ ] Black Rose is offline
Pamaliska
Senior Member
Join Date: Apr 2006
Location: Edinburgh, UK
Old 02-06-2007 , 03:16   Re: name/kick
Reply With Quote #22

Quote:
Originally Posted by [ --<-@ ] Black Rose View Post

Your code is unreliable.
If I knew how to make it flawless, i wpuld not ask for help. I am not a coder, i just collected bits and pieces from this forum and put them together. Therefore I ask for your help to make it work good. I do not intend to be annoying, sorry if it seems to be so.
Pamaliska is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 02-06-2007 , 03:25   Re: name/kick
Reply With Quote #23

You cant get the user's new name using get_user_name().
You would need to use get_user_info()

make a new global var
on disconnect, reset it
set it when setting the task and check it on task executed.
Code:
#include <amxmodx> new g_kick[33] public plugin_init()         register_plugin("", "", "") public client_disconnect(id)     g_kick[id] = false public kick(id) {     if ( g_kick[id] )         server_cmd("kick #%d ^"MY message^"", get_user_userid(id)) } public client_infochanged(id) {     new name[32]     get_user_info(id, "name", 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)         g_kick[id] = true     } }

Last edited by [ --<-@ ] Black Rose; 02-07-2007 at 02:38.
[ --<-@ ] Black Rose is offline
Pamaliska
Senior Member
Join Date: Apr 2006
Location: Edinburgh, UK
Old 02-06-2007 , 15:33   Re: name/kick
Reply With Quote #24

Quote:
Originally Posted by [ --<-@ ] Black Rose View Post

make a new global var
on disconnect, reset it
set it when setting the task and check it on task executed.
Code:
#include <amxmodx> new g_kick[32] public plugin_init()         register_plugin(PLUGIN, VERSION, AUTHOR) public client_disconnect(id)     g_kick[id] = false public kick(id) {     if ( g_kick[id] )         server_cmd("kick #%d ^"MY message^"", get_user_userid(id)) } public client_infochanged(id) {     new name[32]     get_user_info(id, "name", 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)         g_kick[id] = true     } }
Does not do anything at all now.
Pamaliska is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 02-07-2007 , 11:23   Re: name/kick
Reply With Quote #25

Quote:
Originally Posted by [ --<-@ ] Black Rose View Post
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 ^"", uid)
}
}
}

Here's why. Code:

new newname[32], oldname[32]

get_user_name(id, oldname, 31)

get_user_info(id, "name", newname, 31)
I have to mix those ? , I did that, it wouldn't work
Code:
public client_infochanged(id) {
    new newname[32], oldname[32], name[32], uid[32]
    get_user_name(id, name, 31)
    get_user_userid(id, uid, 31)
    get_user_name(id, oldname, 31) 
    get_user_info(id, "name", newname, 31)
    if(containi(name, "Hunter") != -1) {
        if(!(get_user_flags(id)&ADMIN_LEVEL_D) && id) {
            server_cmd("kick #%d ^"A message :D^"", uid)
        }
    }
}
It's a big problem to me to understand this because it's generaly in english and I don't quite understand english verry much... like the word "var", I don't know that it stands for or what it means or even what should it be replaced with in a sentence
__________________

Last edited by Hunter-Digital; 02-07-2007 at 11:26.
Hunter-Digital is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 02-07-2007 , 16:43   Re: name/kick
Reply With Quote #26

get_user_info(id, "name", newname, 31)

Thats the name you should check, still you're not doing that.
[ --<-@ ] Black Rose is offline
Pamaliska
Senior Member
Join Date: Apr 2006
Location: Edinburgh, UK
Old 02-07-2007 , 19:13   Re: name/kick
Reply With Quote #27

Made it to work (new bool:/ == true), but sometimes it does not let the users with the checked name to reconnect right away (sometimes only the third attempt is successful). Any ideas on that.
Cheers.
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 13:47.


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