Raised This Month: $ Target: $400
 0% 

Force Admin Tag 1.0


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
pizzahut
Senior Member
Join Date: Oct 2004
Old 03-24-2005 , 17:10  
Reply With Quote #1

Changes:
- Moved admin tag behind the name.
- Users who don't have admin access will be renamed if they put on admin tag.
- Name is shortened if too long to add tag.
- Admins with immunity won't get renamed.

Code:
#include <amxmodx> #include <amxmisc> public plugin_init(){     register_plugin("Force Admin Tags", "9a", "pizzahut")     register_cvar("amx_forcetag", "1") } public client_putinserver(id){         set_task(1.5,"admin_entered",id) }         public admin_entered(id){     new name[32]     get_user_name(id, name, 31)     return force_tag(id, name) } force_tag(id, name[]) {     if (get_cvar_num("amx_forcetag")==1){         if (is_user_admin(id) && (containi(name, "[admin]")<0) && (!access(id, ADMIN_IMMUNITY))) {             copy(name,23,name)             client_cmd(id,"name ^"%s [Admin]^"", name)         }         if ((!is_user_admin(id)) && (containi(name, "[admin]")>=0)) {             deletei(name, "[admin]")             trim(name)             if (strlen(name) == 0) {                 copy(name, 7, "Player")             }             client_cmd(id, "name ^"%s^"", name)         }     }     return PLUGIN_CONTINUE } public client_infochanged(id){         new name[32]         get_user_info(id, "name", name, 31)         return force_tag(id, name) } deletei(text[], const what[]) {     new pos     new len     new i     pos = containi(text, what)     while (pos>=0) {         len = strlen(what)         i = 0         while (text[pos+len+i]!=0) {             text[pos+i] = text[pos+len+i]             i++         }         text[pos+i] = 0         pos = containi(text, what)     } }
__________________
My AMXX plugins (content date 2007-03-29, link check 2017-04-26)

Plugins for the Royston Vasey TFC server - These are UNSUPPORTED, except those which have been published at AMX Mod X.
pizzahut is offline
Reply



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 22:25.


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