AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Auto kicking say brb script help (https://forums.alliedmods.net/showthread.php?t=10752)

teame06 02-28-2005 04:01

Auto kicking say brb script help
 
Ok here my problem when someone get kick for saying brb or /brb on my server. When they have a name like "W. People" when it does it kick. It list the reason as "People".

Quote:

You have been disconnected from the server.
Reason: Kicked: "People"
How can i fix this to this

Quote:

You have been disconnected from the server.
Reason: Kicked
or
Quote:

You have been disconnected from the server.
Reason: Kicked: "You have been auto kicked by the server."
Code:

#include <amxmodx>
#include <amxmisc>

public brbkick( id ) {

    new name[34]
    get_user_name(id,name,32)

    if ( get_user_flags(id) & ADMIN_IMMUNITY ) return PLUGIN_CONTINUE
    else
    {
        server_cmd("amx_kick %s",name, "You have been autokick by the server.")
        client_print(0,print_chat,"[EniGmA] Server:  Autokicking %s", name)
    }

    return PLUGIN_HANDLED;
}

public plugin_init() {
    register_plugin("Kick Say Brb","0.1","EniGmA")
    register_clcmd("say /brb","brbkick")
    register_clcmd("say brb","brbkick")
    return PLUGIN_CONTINUE;
}

Thank you if you can help me.

Extremeone 02-28-2005 08:15

well duh all that script does is kick anyone without ADMIN_IMMUNITY
looks like you took part of the code and thats all

teame06 02-28-2005 09:48

yea that what i want that script to do.

xeroblood 02-28-2005 09:54

You are passing two extra parameters to amx_kick, so you need another %s in your command..

Also, if you have spaces in one of the parameters (like the reason), then you should surround it in quotes, otherwise it will look like more than one parameter...

Code:
server_cmd("amx_kick %s %s", name, "^"You have been autokicked by the server.^"") // or just do: server_cmd("amx_kick %s ^"You have been autokicked by the server.^"", name)

teame06 02-28-2005 10:28

Thanks xeroblood.

If their name is like W. People it won't say "You have been autokicked by the server.", but it will say People when they get kick for reason.

xeroblood 02-28-2005 10:39

Hrmm.. maybe try:

Code:
server_cmd("amx_kick ^"%s^" ^"You have been autokicked by the server.^"", name)

:?

teame06 02-28-2005 22:29

Thanks xeroblood that fix it.


All times are GMT -4. The time now is 13:58.

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