Raised This Month: $ Target: $400
 0% 

How to check name


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
reinert
Veteran Member
Join Date: Feb 2007
Old 12-29-2010 , 07:12   How to check name
Reply With Quote #1

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.
reinert is offline
SpeeDeeR
Veteran Member
Join Date: Mar 2010
Location: Bulgaria
Old 12-29-2010 , 07:55   Re: How to check name
Reply With Quote #2

Code:
 get name
if(containi(name,"") !=  -1)
{
use amx_nick or client_cmd
}
SpeeDeeR is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-29-2010 , 08:06   Re: How to check name
Reply With Quote #3

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

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
reinert
Veteran Member
Join Date: Feb 2007
Old 12-29-2010 , 11:29   Re: How to check name
Reply With Quote #4

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)
???
reinert is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-29-2010 , 11:35   Re: How to check name
Reply With Quote #5

if( !( get_user_flags(id) & ADMIN_KICK|ADMIN_BAN ) )
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
reinert
Veteran Member
Join Date: Feb 2007
Old 12-29-2010 , 16:57   Re: How to check name
Reply With Quote #6

thanks!
reinert is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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