I have one plugin protect tag but have problem:
This plugin will protect change tag from user
But:
1.
It's not bypass admin a - immunity
2. For example: One player with Dark Killer name come into server, his name change into [fifa] Dark Killer.
The player change his name into Dark Killer but his name is auto change into [fifa] Dark, not into [fifa] Dark Killer (it only take one work of sentence). Please tell me fix it!
Please help me. Thank you so much!
============================================= ========
Code:
#include <amxmodx>
#include <amxmisc>
new g_amx_tagprotect
new g_amx_clantag
public plugin_init()
{
register_plugin("BS Clan Tag", "1", "pizzahut")
g_amx_tagprotect = register_cvar("amx_tagprotect", "1")
g_amx_clantag = register_cvar("amx_clantag", "[fifa] ")
}
public client_putinserver(id)
{
force_tag(id)
return PLUGIN_CONTINUE
}
public client_infochanged(id)
{
force_tag(id)
return PLUGIN_CONTINUE
}
force_tag(id)
{
if(get_pcvar_num(g_amx_tagprotect) == 0)
return
new name[32]
get_user_info(id, "name", name, 31)
new clantag[24]
get_pcvar_string(g_amx_clantag,clantag,23)
if((!is_user_admin(id)) && (containi(name, clantag)>=0))
{
deletei(name, clantag)
trim(name)
if(strlen(name) == 0)
copy(name, 7, "Player")
set_user_info(id, "name", 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)
}
}