View Single Post
ZaX
Senior Member
Join Date: Jan 2015
Old 07-03-2020 , 02: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; 07-03-2020 at 02:07.
ZaX is offline