Raised This Month: $ Target: $400
 0% 

help me add admin flag to this plugin


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-10-2011 , 16:26   Re: help me add admin flag to this plugin
Reply With Quote #6

PHP Code:
#include <amxmodx>
#include <amxmisc>

#define ACCESS_LEVEL ADMIN_RESERVATION

new cvar_tag

public plugin_init()
{    
    
cvar_tag register_cvar("amx_tag""[tag]")
}

public 
client_connect(id)
{
    
check_tag(id)
}

public 
client_infochanged(id)
{
    
check_tag(id)
}

check_tag(id)
{
    new 
tag[32], name[65], temp[32]
    
get_pcvar_string(cvar_tagtag31)
    
get_user_name(idname64)
    
copy(tempstrlen(tag), name)
    if(
equali(temptag))
    {
        if(!
access(idACCESS_FLAG))
        {
            
remove_tag(id)
        }
    }
    else
    {
        if(
access(idACCESS_FLAG))
        {
            
add_tag(id)
        }
    }
}

add_tag(id)
{
    new 
tag[32], name[65], newname[65]
    
get_pcvar_string(cvar_tagtag31)
    
get_user_name(idname64)
    
format(newname64"%s %s"tagname)
    
set_user_info(id"name"newname)
}

remove_tag(id)
{
    new 
tag[32], name[65]
    
get_pcvar_string(cvar_tagtag31)
    
get_user_name(idname64)
    if(
equali(name[strlen(tag)+1], " ")) // if there is a space between tag and name
    
{
        
format(tag64"%s "tag)
    }
    
replace(namestrlen(tag), tag"")
    
set_user_info(id"name"name)

Change ACCESS_FLAG to whatever flag you need.
For the list of admin flag constants, look here: http://www.amxmodx.org/funcwiki.php?...=1#const_admin
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
 



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 19:45.


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