Raised This Month: $ Target: $400
 0% 

Automatic Kick


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sen-me
Junior Member
Join Date: Jun 2006
Old 06-24-2006 , 14:07   Automatic Kick
Reply With Quote #1

How can I kick automaticly ppl., who not contains a string in their name?

I only want to know, how to set up a function that check every player ingame, and when new player comes in, to check these too. (Sorry for my english... I'm german)
sen-me is offline
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 06-24-2006 , 14:14   Re: Automatic Kick
Reply With Quote #2

The Restrict Names plugin could do that.
__________________
Brad is offline
sen-me
Junior Member
Join Date: Jun 2006
Old 06-24-2006 , 14:54   Re: Automatic Kick
Reply With Quote #3

Hmmm, other question, what public function (example client_PreThink) will start, when a player connect to the server?
client_connect doesn't work...

or is this script false?

Code:
#include <amxmodx>
#include <amxmisc>

new bool:train=false

public plugin_init()
{
    register_plugin("Training", "1.0", "sen-me http://privat.multi-pages.de")
    register_concmd("amx_training", "training", ADMIN_KICK, " 1/2 on/off")
    register_cvar("mp_training", "0")
}

public training(id, level, cid)
{
    if(!cmd_access(id, level, cid, 2)) return PLUGIN_HANDLED
    
    new arg[5]
    read_argv(1, arg, 4)
    
    if(equal(arg, "1") || equal(arg, "on"))
    {
        if(get_cvar_num("mp_training") == 1) client_print(id, print_chat, "Clan training! Other ppl. kicked!")
        else client_print(0, print_chat, "Clan training! Other ppl. kicked!")
        
        train=true
        server_cmd("sv_restartround 5")
    }
    
    if(equal(arg, "0") || equal(arg, "off"))
    {
        train=false
        
        if(get_cvar_num("mp_training") == 1) client_print(id, print_chat, "Clan training OFF!")
        else client_print(0, print_chat, "Clan training OFF!")
    }
    
    return PLUGIN_HANDLED
}


public client_connect(id)
{
    if(!train) return PLUGIN_HANDLED
    
    new pName[32]
    get_user_name(id, pName, 31)
    
    if(!containi(pName, "$F3"))
    {
        new player = cmd_target(id, pName, 1), userid2
        
        if(!player) return PLUGIN_HANDLED
        
        userid2 = get_user_userid(player)
        
        if(get_cvar_num("mp_training") == 0) client_print(0, print_chat, "%L", LANG_PLAYER, "ADMIN_KICK_1", pName)
        
        server_cmd("kick #%d ^"%s^"", userid2, "Sorry, but here is training! Try it later again!")
    }
    
    return PLUGIN_HANDLED
}
sen-me is offline
twistedeuphoria
Veteran Member
Join Date: Jul 2004
Old 06-24-2006 , 16:09   Re: Automatic Kick
Reply With Quote #4

Try using client_putinserver.
__________________
twistedeuphoria is offline
sen-me
Junior Member
Join Date: Jun 2006
Old 06-25-2006 , 04:28   Re: Automatic Kick
Reply With Quote #5

dont work...
sen-me is offline
Gizmo
Senior Member
Join Date: May 2006
Location: Sweden
Old 06-25-2006 , 05:30   Re: Automatic Kick
Reply With Quote #6

Why dont you just set a server password?
__________________
Gizmo is offline
sen-me
Junior Member
Join Date: Jun 2006
Old 06-25-2006 , 06:14   Re: Automatic Kick
Reply With Quote #7

because i dont want tell every member the password...
this way is esaier
sen-me is offline
Gizmo
Senior Member
Join Date: May 2006
Location: Sweden
Old 06-25-2006 , 07:36   Re: Automatic Kick
Reply With Quote #8

Here is a working version for you
amx_training will set it on and off.
Attached Files
File Type: sma Get Plugin or Get Source (traning.sma - 534 views - 1.6 KB)

Last edited by Gizmo; 06-25-2006 at 07:42.
Gizmo is offline
sen-me
Junior Member
Join Date: Jun 2006
Old 06-25-2006 , 08:47   Re: Automatic Kick
Reply With Quote #9

thx it works, but what does register_event("ResetHud"...?
sen-me is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 06-25-2006 , 08:50   Re: Automatic Kick
Reply With Quote #10

Quote:
Originally Posted by sen-me
thx it works, but what does register_event("ResetHud"...?
It's an event that gets called whenever a player spawns. I believe it's also called shortly after a round ends from what I've experienced in the past.
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x 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 07:56.


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