Raised This Month: $19 Target: $400
 4% 

[Solved] How to Add Level tag in Chat


Post New Thread Reply   
 
Thread Tools Display Modes
real sap
Member
Join Date: Aug 2015
Location: India
Old 04-25-2016 , 01:26   Re: How to Add Level tag in Chat
Reply With Quote #11

Thanks for your help siriusmd99

but compiling error
warning 217 losse indentication on line 22 and 59
real sap is offline
Send a message via Skype™ to real sap
tousif
AlliedModders Donor
Join Date: Nov 2014
Location: India
Old 04-25-2016 , 03:44   Re: How to Add Level tag in Chat
Reply With Quote #12

Quote:
Originally Posted by real sap View Post
Thanks for your help siriusmd99

but compiling error
warning 217 losse indentication on line 22 and 59
Ignore them they aren't any big errors .

Last edited by tousif; 04-25-2016 at 03:45.
tousif is offline
real sap
Member
Join Date: Aug 2015
Location: India
Old 04-25-2016 , 05:33   Re: How to Add Level tag in Chat
Reply With Quote #13

Quote:
Originally Posted by tousif View Post
Ignore them they aren't any big errors .
Oke but PeRfEcT is better than OK

One thing more that can you please add one more tag like ADMIN_LEVEL_D or U for admins ??
real sap is offline
Send a message via Skype™ to real sap
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 04-25-2016 , 16:42   Re: How to Add Level tag in Chat
Reply With Quote #14

"[ADMIN]" Prefix in chat for admins which have flag "u" in their acces?
siriusmd99 is offline
real sap
Member
Join Date: Aug 2015
Location: India
Old 04-26-2016 , 12:53   Re: How to Add Level tag in Chat
Reply With Quote #15

Quote:
Originally Posted by siriusmd99 View Post
"[ADMIN]" Prefix in chat for admins which have flag "u" in their acces?
Yes really thanks to you ... can you plz make it admins for U acces, kindy plz remove line errors .

Last edited by real sap; 04-26-2016 at 12:57.
real sap is offline
Send a message via Skype™ to real sap
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 04-27-2016 , 16:03   Re: [Solved] How to Add Level tag in Chat
Reply With Quote #16

Loose identitation is not an error, it's a warning but it has no effect to the plugin , it tells that code is not arranged properly.
Anyway, i removed the warnings and made [ADMIN] too:

PHP Code:
#include <amxmodx>

native zp_get_user_level(id);

new const 
g_vPrefix[9] = "^x04[VIP]";
new const 
g_aPrefix[12] = "^x04[ADMIN]";

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 
tempflags,
    
szLevel[9], 
    
szTmp[256],
    
szTmp2[256];
    
    
    
get_msg_arg_string(2szTmpcharsmax(szTmp));
    
formatex(szLevelcharsmax(szLevel), "^x04[%d]"zp_get_user_level(id))
    
tempflags get_user_flags(id);
    
    if(!
equal(szTmp"#Cstrike_Chat_All")){
        
        
add(szTmp2charsmax(szTmp2), szLevel);
        
add(szTmp2charsmax(szTmp2), " ");
        
        if(
get_user_flags(id) & ADMIN_LEVEL_H){
            
add(szTmp2charsmax(szTmp2), g_vPrefix);
            
add(szTmp2charsmax(szTmp2), " ");
        }
        
        if(
tempflags ADMIN_MENU){
            
add(szTmp2charsmax(szTmp2), g_aPrefix);
            
add(szTmp2charsmax(szTmp2), " ");
        }
        
        
add(szTmp2charsmax(szTmp2), szTmp);
        
    }
    else
    {
        
        
add(szTmp2charsmax(szTmp2), szLevel);
        
        if(
tempflags ADMIN_LEVEL_H){
            
add(szTmp2charsmax(szTmp2), " ");
            
add(szTmp2charsmax(szTmp2), g_vPrefix);
        }
        if(
tempflags ADMIN_MENU){
            
add(szTmp2charsmax(szTmp2), " ");
            
add(szTmp2charsmax(szTmp2), g_aPrefix);
        }
        
        
add(szTmp2charsmax(szTmp2), "^x03 %s1^x01 :  %s2");
        
    }
    
    
set_msg_arg_string(2szTmp2);
    
    return 
PLUGIN_CONTINUE;
    

siriusmd99 is offline
real sap
Member
Join Date: Aug 2015
Location: India
Old 04-28-2016 , 05:42   Re: [Solved] How to Add Level tag in Chat
Reply With Quote #17

siriusmd99 Thanks alot man it really works
but there is 1 problem it show level only in number so i add
[LVL %d] the it dont show complete levels it show only first digits like my lvl 102 "it show 10" Can you fix it .

plz 1 more favour , can you make that plugin only show levels i dont want that admin or vip tags (Reason: i am using admin prefixs plug so i need custom tags + colured chat. )

Forum is lucky to have guys like you
great job

Last edited by real sap; 04-28-2016 at 05:43.
real sap is offline
Send a message via Skype™ to real sap
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 04-28-2016 , 07:57   Re: [Solved] How to Add Level tag in Chat
Reply With Quote #18

I don't understand , how americans cannot be racist. First you said put vip , second you said put admin tag now you say you dont want admin and vip tag.
Omg.. The problem with LVL is that i made the array only for numbers just change array size :

PHP Code:
szLevel[9
to

PHP Code:
szLevel[12
Because ^x04[%d] has 8 symbols max and array shall have size 9 but if you add LVL then array size shall be 13 (or greater if you want...)

Last edited by siriusmd99; 04-28-2016 at 08:03.
siriusmd99 is offline
real sap
Member
Join Date: Aug 2015
Location: India
Old 04-28-2016 , 09:54   Re: [Solved] How to Add Level tag in Chat
Reply With Quote #19

lel OK np thanks for array Help . Actually i DONT wanna use to much plugins for my server like custom tag , colour chats etc . Sorry my bad

IF you can , it would again be so much help for me ... else you decide (Without Tag lvl plugin)

Anyways , I happy with your this plugin and your help

Last edited by real sap; 04-28-2016 at 10:01.
real sap is offline
Send a message via Skype™ to real sap
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
Reply


Thread Tools
Display Modes

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 15:06.


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