View Single Post
MaNaReaver
Member
Join Date: Apr 2020
Location: India
Old 07-04-2020 , 14:41   Re: Admin Tag issues
Reply With Quote #6

The issue was majorly because I didn't use a set_task in client_infochanged, and that was messing up the functionality. I wanted to make it a simple plugin with less lines of code and this was the best I could do. I hope this helps others out!

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

new name[32], tag[12];
new 
amx_forcetagamx_tag;

public 
plugin_init()
{
    
register_plugin("Tags""1.2""BigBaller Edit")
    
amx_forcetag register_cvar("amx_forcetag""1")
    
amx_tag register_cvar("amx_tag""[AlliedModders]");
    
get_pcvar_string(amx_tagtag12);
}

public 
client_putinserver(idset_task(2.0,"admin_entered",id);

public 
admin_entered(id) if(is_user_admin(id)) force_tag(id);

public 
force_tag(id)
{
    
get_user_name(idname31);

    if (
get_pcvar_num(amx_forcetag) && (containi(nametag) == -1))
    {
        
format(name31"%s %s"tagname);
        
set_user_info(id"name"name);
    }
    return 
PLUGIN_CONTINUE;
}

public 
client_infochanged(idset_task(2.0,"admin_entered",id
__________________
MaNaReaver is offline