AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Automatic Kick (https://forums.alliedmods.net/showthread.php?t=40178)

sen-me 06-24-2006 14:07

Automatic Kick
 
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)

Brad 06-24-2006 14:14

Re: Automatic Kick
 
The Restrict Names plugin could do that.

sen-me 06-24-2006 14:54

Re: Automatic Kick
 
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
}


twistedeuphoria 06-24-2006 16:09

Re: Automatic Kick
 
Try using client_putinserver.

sen-me 06-25-2006 04:28

Re: Automatic Kick
 
dont work...

Gizmo 06-25-2006 05:30

Re: Automatic Kick
 
Why dont you just set a server password?

sen-me 06-25-2006 06:14

Re: Automatic Kick
 
because i dont want tell every member the password...
this way is esaier

Gizmo 06-25-2006 07:36

Re: Automatic Kick
 
1 Attachment(s)
Here is a working version for you
amx_training will set it on and off.

sen-me 06-25-2006 08:47

Re: Automatic Kick
 
thx it works, but what does register_event("ResetHud"...?

v3x 06-25-2006 08:50

Re: Automatic Kick
 
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.


All times are GMT -4. The time now is 07:56.

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