Thread: Help in Script
View Single Post
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 11-28-2014 , 14:01   Re: Help in Script
Reply With Quote #14

PHP Code:
#include <amxmodx>

#define PLUGIN "Tagger"
#define VERSION "1.0"
#define AUTHOR "Gullu Bhai"

new const g_tag[] = "~=NarC^^()~";

new 
g_ig[][] = {
    
"~=NarC^^(S)~",
    
"~=NarC^^(P)~",
    
"~=NarC^^(FuN)~",
    
"~=NarC^^(O)~",
    
"~=NarC^^(C)~"
}

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
}


public 
client_putinserver(client){
    static 
szName[32];
    
get_user_name(client,szName,charsmax(szName)) ;

    if (!
ContainsTag(szName))
    {
        
format(szName,charsmax(szName),"%s %s",g_tag,szName);
        
set_user_info(client,"name",szName);
    }
}  

bool:ContainsTag(const name[])
{
    for (new 
isizeof(g_ig); i++)
    {
        if (
containi(nameg_ig[i]) == 0// Check if tag starts at beginning of name.
            
return true;
    }
    
    return 
false;

__________________

Last edited by hleV; 11-29-2014 at 07:52. Reason: != → ==
hleV is offline