AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   about kick "[16bpp]" problem (https://forums.alliedmods.net/showthread.php?t=93752)

K.K.Lv 06-02-2009 01:16

about kick "[16bpp]" problem
 
yesterday, i wrote a code can kick the player name that add "[16bpp]" in front

the code:
PHP Code:

#include <amxmodx>
#include <amxmisc>
#define PLUGIN_NAME "16bpp_kick"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "K.K.Lv"
public plugin_init()
{
 
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR)
 
set_task(0.1"kick"___"b")
}
public 
kick()
{
 new 
players[32], pnum
 
new playersid
 get_players
(playerspnum)
 for (new 
0pnumi++)
 {
  new 
name[32]
  
playersid players[i]
  if (
is_user_connected(playersid))
  {
   
get_user_name(playersidname31)
   if(
contain(name"[16bpp]") != -1)
   {
    
server_cmd("kick #%d ^"For 16bpp^""get_user_userid(playersid))
   }
  }
 }
 return 
PLUGIN_CONTINUE


any problem here???

TheRadiance 06-02-2009 01:23

Re: about kick "[16bpp]" problem
 
PHP Code:

#include <amxmodx>

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

public 
client_putinserver(id)
{
    new 
sz_nick[32]
    
get_user_name(idsz_nick31)

    if (
containi(sz_nick"[16bpp]"))
        
server_cmd("kick #%i For 16bpp"get_user_userid(id))



ConnorMcLeod 06-02-2009 01:47

Re: about kick "[16bpp]" problem
 
You can also try this :

PHP Code:

#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(idszName)
}

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

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



K.K.Lv 06-02-2009 02:32

Re: about kick "[16bpp]" problem
 
any body know the sXe Injected v7.8,
when a player who video settings are 16-bit has put in server
his name will changed like this:
"playername" ==> "[16bpp] playername"
so ,i want to kick "[16bpp]"
i'm sorry for my bad english!!

K.K.Lv 06-02-2009 02:36

Re: about kick "[16bpp]" problem
 
The Conditions:
1.player has put in server
2.add "[16bpp]" at the front of player name

result:
KICK!!

TheRadiance 06-02-2009 03:32

Re: about kick "[16bpp]" problem
 
Quote:

The Conditions:
1.player has put in server
2.add "[16bpp]" at the front of player name

result:
KICK!!
Posts #2 & #3.

offtop:
for scripters: is there any client command/amx method to detect which mode(16/32bpp) player is using?

stupok 06-02-2009 05:20

Re: about kick "[16bpp]" problem
 
nope

K.K.Lv 06-02-2009 08:18

Re: about kick "[16bpp]" problem
 
Thanks all !!
The problem has been solved !!

soik 04-15-2010 09:58

Re: about kick "[16bpp]" problem
 
KKLv, could you post you plugin?

soik 04-15-2010 13:04

Re: about kick "[16bpp]" problem
 
#2 and #3 were kicking everyone from the server, even who doesn't use 16bpp.


All times are GMT -4. The time now is 14:05.

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