AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to check name (https://forums.alliedmods.net/showthread.php?t=146551)

reinert 12-29-2010 07:12

How to check name
 
Hey, how to check is there matches in name with my tag ?

like, I would like to restrict "[GOLD] >>" tag, for non-admins, when they connect how could I check it, and just change their name from like:

[GOLD] >> reinert, to reinert.

SpeeDeeR 12-29-2010 07:55

Re: How to check name
 
Code:

get name
if(containi(name,"") !=  -1)
{
use amx_nick or client_cmd
}


ConnorMcLeod 12-29-2010 08:06

Re: How to check name
 
PHP Code:

#include <amxmodx>
#include <fakemeta>

#define VERSION "0.0.1"
#define PLUGIN ""

public plugin_init()
{
    
register_plugin(PLUGINVERSION"ConnorMcLeod")
    
register_forward(FM_SetClientKeyValue"SetClientKeyValue")
}

public 
SetClientKeyValue(id, const szInfoBuffer[], const szKey[], const szValue[])
{
    if( 
is_user_connected(id) && equal(szKey"name") && !is_user_admin(id) && containi(szValue"[GOLD] >>") )
    {
        new 
szName[32]
        
copy(szNamecharsmax(szName), szValue)
        
replace(szNamecharsmax(szName), "[GOLD] >>""****")
        
set_user_info(id"name"szName)
        return 
FMRES_SUPERCEDE
    
}
    return 
FMRES_IGNORED



reinert 12-29-2010 11:29

Re: How to check name
 
Does this :

Quote:

if(!(get_user_flags(id) & ADMIN_KICK && get_user_flags(id) & ADMIN_BAN))
is same as this:

Quote:

if(!get_user_flags(id) & ADMIN_KICK && !get_user_flags(id) & ADMIN_BAN)
???

ConnorMcLeod 12-29-2010 11:35

Re: How to check name
 
if( !( get_user_flags(id) & ADMIN_KICK|ADMIN_BAN ) )

reinert 12-29-2010 16:57

Re: How to check name
 
thanks!


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

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