View Single Post
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 04-28-2016 , 11:15   Re: [Solved] How to Add Level tag in Chat
Reply With Quote #20

Only [LVL %d] in chat :

PHP Code:
#include <amxmodx>

native zp_get_user_level(id);

public 
plugin_init()
{
    
    
register_plugin("VIP and Level Prefix""1.0""siriusmd99")
    
register_message(get_user_msgid("SayText"),"handle_chat");
    
}

public 
handle_chat(msgIdmsgDestmsgEnt){
    
    new 
id get_msg_arg_int(1);
    
    if(!
is_user_connected(id)) 
        return 
PLUGIN_HANDLED;
    
    new 
szLevel[13], 
    
szTmp[256],
    
szTmp2[256];
    
    
    
get_msg_arg_string(2szTmpcharsmax(szTmp));
    
formatex(szLevelcharsmax(szLevel), "^x04[LVL %d]"zp_get_user_level(id))
    
    if(!
equal(szTmp"#Cstrike_Chat_All")){
        
        
add(szTmp2charsmax(szTmp2), szLevel);
        
add(szTmp2charsmax(szTmp2), " ");
        
add(szTmp2charsmax(szTmp2), szTmp);
        
    }
    else
    {
        
        
add(szTmp2charsmax(szTmp2), szLevel);
        
add(szTmp2charsmax(szTmp2), "^x03 %s1^x01 :  %s2");
        
    }
    
    
set_msg_arg_string(2szTmp2);
    
    return 
PLUGIN_CONTINUE;
    

siriusmd99 is offline