AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [VIP] Tag in chat (https://forums.alliedmods.net/showthread.php?t=206274)

fanatix 01-20-2013 14:26

[VIP] Tag in chat
 
I dont know how to set prefix [V.I.P] in chat for users who have flag "t" (ADMIN_LEVEL_H), can someone give me an idea, i want to learn the steps :)

Can i do it like this:

PHP Code:

#include <amxmodx>  
#include <amxmisc>  
#include <colorchat>  

public plugin_init() {  
    
register_plugin("VIP_say""1.0""uknown")  
    
register_clcmd("say""vip")  
}  

public 
vip(id){ 
    if(
get_user_flags(id) & ADMIN_LEVEL_H
    { 
        new 
said[192], name[30
        
get_user_name(id,name,29
        
read_args(said,191
        
remove_quotes(said
        
ColorChat(0GREEN,"[V.I.P] ^3%s ^1: %s",name,said
        return 
PLUGIN_HANDLED 
    




fanatix 01-26-2013 13:06

Re: [VIP] Tag in chat
 
Anyone little help, some hint ?

michal123 01-26-2013 14:28

Re: [VIP] Tag in chat
 
Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "speedkill"

public plugin_init(){
        register_plugin(PLUGIN, VERSION, AUTHOR);
        register_message(get_user_msgid("SayText"),"handleSayText");
}
public handleSayText(msgId, msgDest, msgEnt){
        new id = get_msg_arg_int(1);
       
        if(is_user_connected(id) && get_user_flags(id) & ADMIN_LEVEL_H){
                new szTmp[256],
                        szTmp2[256];
                       
                get_msg_arg_string(2, szTmp, charsmax(szTmp));
               
                new szPrefix[64] = "^x04[VIP]";
               
                if(!equal(szTmp, "#Cstrike_Chat_All")){
                        add(szTmp2, charsmax(szTmp2), szPrefix);
                        add(szTmp2, charsmax(szTmp2), " ");
                        add(szTmp2, charsmax(szTmp2), szTmp);
                }
                else{
                        add(szTmp2, charsmax(szTmp2), szPrefix);
                        add(szTmp2, charsmax(szTmp2), "^x03 %s1^x01 :  %s2");
                }
                set_msg_arg_string(2, szTmp2);
        }
        return PLUGIN_CONTINUE;
}



All times are GMT -4. The time now is 13:31.

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