Snippet TAG ME ( HardCode )

  • You can only download a plugin when you are REGISTERED, so Get yourself Registered first, its FREE and wont take more than 10 Secs

DiGiTaL

Active Member
Staff member
Administrator
Moderator
Dec 9, 2017
191
36
28
19
Rajasthan, India
jatinsarda.me
#1
This TAG Plugin Will HardCode the TAG defined in plugin before user's Name
So think before using the plugin, i made it just on a Request !
C++:
#include <amxmodx>
new tag[] = "[PRO]"

public plugin_init(){
    register_plugin("TAG ME", "1.0", "DiGiTaL")
    register_clcmd("say /tag", "setTag")
}

public setTag(id){
    new szName[32]
    get_user_name(id, szName, charsmax(szName))
    if(!b_HasTag(szName))
        client_cmd(id, "name ^"%s %s^"", tag, szName)
    else if(b_HasTag(szName)){
        replace_all(szName, charsmax(szName), tag, "")
        client_cmd(id, "name ^"%s^"", szName)
    }
    return PLUGIN_CONTINUE
}

bool:b_HasTag(const username[]){
    for (new i; i < sizeof(tag); i++){
        if (containi(username, tag[i]) == 0)
            return true;
    } return false;
}
Just change the Value for tag which is by default is [PRO]
Original Thread link on Allied :
 

soumyadip77

Member
Moderator
Dec 10, 2017
66
6
8
17
#2
whats about this

PHP:
new const TAG[]= "TEST"

public tag_me(id)
{
    new szName[ MAX_NAME_LENGTH ];
    get_user_name(id, szName, 32);

    if (!contain(szName, TAG))
    {
        format(szName, 32, "%s %s", TAG, szName);
        client_cmd(id, "name ^"%s^"", szName);
    }
    return 0;
}
 

soumyadip77

Member
Moderator
Dec 10, 2017
66
6
8
17
#3
try to add tag
PHP:
 new const TAG[]="TEST"
under local not public if u useing it 1 time beq global variable 1 time use take more resource :D try to make all thing in 1 local :D i guess you all under stand what i am try to saying :)
 

DiGiTaL

Active Member
Staff member
Administrator
Moderator
Dec 9, 2017
191
36
28
19
Rajasthan, India
jatinsarda.me
#5
Posted this in March when i barely know scripting .. now i know a lil i will update this soon and your method is like doing 40%of total work .. where is untag ?? U get it. ?

And you are retrieving max name length to keep in not hardcoded, then you used 32 size in getting user name...