Counter-Strike
[AMXX] Name Prefix (AutoTAG)
Submitted by geti, 25-02-2018, 12:31 AM, Thread ID: 77041
Thread Closed
25-02-2018, 12:31 AM
#1 Emri i Plugin: Name Prefix (AutoTAG) Autor: Freesh Onee Version: 1.0a Pershkrimi: Ky plugin bashkangjit nje prefix/tag tek cdo lojtar ne server. Komanda(cvar): mp_client_prefix - prefix i lojtarit Source code:
#include<amxmodx>
#include<amxmisc>
newg_cvar;
publicplugin_init(){
g_cvar=register_cvar("mp_client_prefix","Prefix|");
register_message(get_user_msgid("SayText"),"msg_SayText")
}
publicclient_putinserver(id){
newszPrefix[40];
get_pcvar_string(g_cvar,szPrefix,charsmax(szPrefix)-1);
staticszOldName[33];
get_user_name(id,szOldName,charsmax(szOldName)-1);
staticszName[33];
get_user_info(id,"name",szName,charsmax(szName)-1);
newthe_name[40];
formatex(the_name,charsmax(the_name)-1,"%s%s",szPrefix,szName);
if(is_user_connected(id)){
if(contain(szOldName,szPrefix)!=-1)return;
set_user_info(id,"name",the_name);
}
}
publicclient_infochanged(id){
if(!is_user_connected(id))returnPLUGIN_HANDLED;
newszPrefix[40];
get_pcvar_string(g_cvar,szPrefix,charsmax(szPrefix)-1);
staticszName[33];
get_user_info(id,"name",szName,charsmax(szName)-1);
staticszOldName[33];
get_user_name(id,szOldName,charsmax(szOldName)-1);
newthe_name[40];
formatex(the_name,charsmax(the_name)-1,"%s%s",szPrefix,szName);
if(szOldName[0]){
if(!equal(szName,szOldName)){
if(contain(szName,szPrefix)!=-1)returnPLUGIN_HANDLED;
set_user_info(id,"name",the_name);
client_print(0,print_chat,"%schangedhisnamein%s.",szOldName,the_name);
returnPLUGIN_HANDLED;
}
}
returnPLUGIN_CONTINUE;
}
publicmsg_SayText(msg_id,msg_dest,msg_entity){
newarg2[32]
get_msg_arg_string(2,arg2,charsmax(arg2))
staticconstszNameChange[]="#Cstrike_Name_Change"
if(equal(arg2,szNameChange))returnPLUGIN_HANDLED
returnPLUGIN_CONTINUE
}
#include<amxmodx>
#include<amxmisc>
newg_cvar;
publicplugin_init(){
g_cvar=register_cvar("mp_client_prefix","Prefix|");
register_message(get_user_msgid("SayText"),"msg_SayText")
}
publicclient_putinserver(id){
newszPrefix[40];
get_pcvar_string(g_cvar,szPrefix,charsmax(szPrefix)-1);
staticszOldName[33];
get_user_name(id,szOldName,charsmax(szOldName)-1);
staticszName[33];
get_user_info(id,"name",szName,charsmax(szName)-1);
newthe_name[40];
formatex(the_name,charsmax(the_name)-1,"%s%s",szPrefix,szName);
if(is_user_connected(id)){
if(contain(szOldName,szPrefix)!=-1)return;
set_user_info(id,"name",the_name);
}
}
publicclient_infochanged(id){
if(!is_user_connected(id))returnPLUGIN_HANDLED;
newszPrefix[40];
get_pcvar_string(g_cvar,szPrefix,charsmax(szPrefix)-1);
staticszName[33];
get_user_info(id,"name",szName,charsmax(szName)-1);
staticszOldName[33];
get_user_name(id,szOldName,charsmax(szOldName)-1);
newthe_name[40];
formatex(the_name,charsmax(the_name)-1,"%s%s",szPrefix,szName);
if(szOldName[0]){
if(!equal(szName,szOldName)){
if(contain(szName,szPrefix)!=-1)returnPLUGIN_HANDLED;
set_user_info(id,"name",the_name);
client_print(0,print_chat,"%schangedhisnamein%s.",szOldName,the_name);
returnPLUGIN_HANDLED;
}
}
returnPLUGIN_CONTINUE;
}
publicmsg_SayText(msg_id,msg_dest,msg_entity){
newarg2[32]
get_msg_arg_string(2,arg2,charsmax(arg2))
staticconstszNameChange[]="#Cstrike_Name_Change"
if(equal(arg2,szNameChange))returnPLUGIN_HANDLED
returnPLUGIN_CONTINUE
}
Users browsing this thread: 2 Guest(s)