AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   16 bit not give kick :| (https://forums.alliedmods.net/showthread.php?t=156870)

jellytin 05-13-2011 09:20

16 bit not give kick :|
 
Quote:

#include <amxmodx>
#include <fakemeta>

public plugin_init()
{
register_plugin("[16bpp]", "1.0", "K.K.Lv")

register_forward(FM_ClientConnect, "ClientConnect", 1)
register_forward(FM_SetClientKeyValue, "SetClientKeyValue", 1)
}

public
ClientConnect(id, const szName[])
{
CheckPlayer(id, szName)
}

public
SetClientKeyValue(id, InfoBuffer, szKey[], szValue[])
{
if(
equal(szKey, "name") )
{
CheckPlayer(id, szValue)
}
}

CheckPlayer(id, const szName[])
{
if(
containi(szName, "[16bpp]") != -1 )
{
server_cmd("kick #%d ^"For 16bpp^"", get_user_userid(id))
}
}

what do plz help :|

SonicSonedit 05-13-2011 12:14

Re: 16 bit not give kick :|
 
add
PHP Code:

server_exec() 

after
PHP Code:

server_cmd("kick #%d ^"For 16bpp^""get_user_userid(id)) 

Also I'm not sure that FM's clientconnect passes player name after id.

jellytin 05-13-2011 13:35

Re: 16 bit not give kick :|
 
plz help :O fix this plugin i need 2 this is give kick who play witch 16 bit from my server :D ty.

biscuit628 05-13-2011 17:05

Re: 16 bit not give kick :|
 
PHP Code:

#include <amxmodx>

public plugin_init()
{
    
register_plugin("Kick 16bpp name""1.0""Biscuit")
}

public 
client_putintserver(id)
{
    if(
is_user_connected(id))
    {
        static 
name[33]
        
get_user_name(id,name,32)
        
        if( 
containi(name"[16bpp]") != -)
        {
            
server_cmd("kick #%d ^"For 16bpp^""get_user_userid(id))
        }
    }


try this

K.K.Lv 05-13-2011 21:21

Re: 16 bit not give kick :|
 
OMG, this connor's code !
IMO, check player name when player put in server, and client info changed !
I think that is enough !

edited:un-test!
Code:

#include <amxmodx>
 
#define PLUGIN_NAME        "Kick 16-bit"
#define PLUGIN_VERSION        "1.0"
#define PLUGIN_AUTHOR        "K.K.Lv"
 
public plugin_init()
{
        register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);
}
 
public client_putinserver(id)
{
        if (!is_user_connected(id))
                return;
        static szName[32];
        get_user_name(id, szName, charsmax(szName));
 
        if (contain(szName, "[16bpp]") != -1) {
                server_cmd("kick #%d ^"for 16-bit set^"", get_user_userid(id));
      }
}
 
public client_infochanged(id)
{
        if (!is_user_connected(id))
                return ;
 
        static szNewName[32], szOldName[32];
 
        get_user_name(id, szOldName, charsmax(szOldName));
        get_user_info(id, "name", szNewName, charsmax(szNewName));
 
        if (!equal(szNewName, szOldName)) {
                if (contain(szNewName, "[16bpp]") != -1) {
                        server_cmd("kick #%d ^"for 16-bit set^"", get_user_userid(id));
                }
        }
}


K.K.Lv 05-13-2011 21:25

Re: 16 bit not give kick :|
 
Quote:

Also I'm not sure that FM's clientconnect passes player name after id.
FM_ClientConnect, // bool ) (ent, const szName[], const szAddress[], const szRejectReason[128])

jellytin 05-14-2011 03:13

Re: 16 bit not give kick :|
 
Quote:

Originally Posted by K.K.Lv (Post 1468879)
OMG, this connor's code !
IMO, check player name when player put in server, and client info changed !
I think that is enough !

edited:un-test!

Quote:

Originally Posted by K.K.Lv (Post 1468879)

Code:

#include <amxmodx>
 
#define PLUGIN_NAME        "Kick 16-bit"
#define PLUGIN_VERSION        "1.0"
#define PLUGIN_AUTHOR        "K.K.Lv"
 
public plugin_init()
{
        register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);
}
 
public client_putinserver(id)
{
        if (!is_user_connected(id))
                return;
        static szName[32];
        get_user_name(id, szName, charsmax(szName));
 
        if (contain(szName, "[16bpp]") != -1) {
                server_cmd("kick #%d ^"for 16-bit set^"", get_user_userid(id));
      }
}
 
public client_infochanged(id)
{
        if (!is_user_connected(id))
                return ;
 
        static szNewName[32], szOldName[32];
 
        get_user_name(id, szOldName, charsmax(szOldName));
        get_user_info(id, "name", szNewName, charsmax(szNewName));
 
        if (!equal(szNewName, szOldName)) {
                if (contain(szNewName, "[16bpp]") != -1) {
                        server_cmd("kick #%d ^"for 16-bit set^"", get_user_userid(id));
                }
        }
}




this give kick when i change in server for 16 bit i need when player come to my serve and the mode give him kick because he use 16 bit :|


ConnorMcLeod 05-14-2011 03:16

Re: 16 bit not give kick :|
 
Which program is adding [16bpp] to players names ?
If you hope that those plugins will kick 16bit players without any external program, you are wrong, and if you run any of those external programs, aren't those programs capable to force players to use 32bits ?

K.K.Lv 05-14-2011 04:21

Re: 16 bit not give kick :|
 
Quote:

Originally Posted by ConnorMcLeod (Post 1469011)
Which program is adding [16bpp] to players names ?

the sXe will check your video setting !
will adding "[16bpp]" to player's name when check the video setting is 16-bit !


All times are GMT -4. The time now is 04:27.

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