Raised This Month: $2 Target: $400
 0% 

Admin Tag issues


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MaNaReaver
Member
Join Date: Apr 2020
Old 06-29-2020 , 13:02   Admin Tag issues
Reply With Quote #1

Hey AM,

I wrote a small snippet for an old plugin by Bigballer, but I was unable to force tagging admins when they remove their tag. How can I achieve this? Thanks

PHP Code:
public client_putinserver(idset_task(3.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(idadmin_entered(id); 
MaNaReaver is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-02-2020 , 23:39   Re: Admin Tag issues
Reply With Quote #2

I did something similar to this a long while back where the requester was asking for a plugin to add points to their name. I can't find it right now but you might be able to find it if you search hard enough (using my name will probably help). If you can't find it I'll see if I can come up with something.
__________________
fysiks is offline
ZaX
Senior Member
Join Date: Jan 2015
Old Yesterday , 01:06   Re: Admin Tag issues
Reply With Quote #3

Im not sure if this is the best way, but it should work
Code:
#include <amxmodx> #include <amxmisc> #include <fakemeta> #define TAG "MyTag" new pCvarForceTag public plugin_init() {     pCvarForceTag = register_cvar("amx_force_tag", "1"); } public client_putinserver(id) {     if(is_user_admin(id))     {         set_task(2.0, "ForceNameChange", id);     } } public client_infochanged(id) {     new szOldName[32], szNewName[32];     get_user_info(id, "name", szNewName, charsmax(szNewName));     get_user_name(id, szOldName, charsmax(szOldName));     if(!equal(szNewName, szOldName))     {         if(is_user_admin(id))         {             set_task(2.0, "ForceNameChange", id);         }     } } public ForceNameChange(id) {     ForceTag(id); } public ForceTag(id) {     new szName[32]; get_user_name(id, szName, charsmax(szName));     new szNewName[32];     if( get_pcvar_num(pCvarForceTag) && (containi(szName, TAG) == -1))     {         formatex(szNewName, charsmax(szNewName), "%s %s", TAG, szName);         set_user_info(id, "name", szNewName);     } }

Last edited by ZaX; Yesterday at 01:07.
ZaX is offline
MaNaReaver
Member
Join Date: Apr 2020
Old Yesterday , 16:25   Re: Admin Tag issues
Reply With Quote #4

Thanks everyone, I checked out your plugins, and was able to rectify the issue in my own one
__________________
MaNaReaver is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old Today , 00:16   Re: Admin Tag issues
Reply With Quote #5

That's great to hear. If you post your final working solution, it may come in handy for future requests of a similar nature. That's one of the great things about an open source community.
__________________
fysiks is offline
Reply


Thread Tools
Display Modes

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 12:09.


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