Raised This Month: $ Target: $400
 0% 

Message showing twice.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 04-27-2012 , 09:52   Message showing twice.
Reply With Quote #1

title says all. When i type something in chat, the prefix and colors are correct, but it's showing the message twice, why?

PHP Code:
#include <amxmodx>

#define VERSION "1.0"

new szSayTextszMaxPlayers

public plugin_init() {
    
register_plugin("AdminChat"VERSION"NapoleoN#")
    
    
register_clcmd("say""HandleSay")
    
    
szSayText get_user_msgid("SayText")
    
szMaxPlayers get_maxplayers()
    
register_message(szSayText"MsgDuplicate")
}

public 
MsgDuplicate(id) {
    return 
PLUGIN_HANDLED
}

public 
HandleSay(id) {
    new 
arg[100], szName[32]; get_user_name(idszNamecharsmax(szName))
    
    
read_args(argcharsmax(arg))
    
remove_quotes(arg)
    
    if(
get_user_flags(id) & ADMIN_KICK && is_valid_msg(arg)) {
        ( 
is_user_alive(id) ? format(argcharsmax(arg), "^x04[Admin]^x03 %s: %s"szNamearg) : format(argcharsmax(arg), "^x03*DEAD*^x04 [Admin]^x03 %s: %s"szNamearg))
    }
    
    for(new 
1<= szMaxPlayersi++) {
        if(!
is_user_connected(i))
            continue
        if(
is_user_alive(id) && is_user_alive(i) || !is_user_alive(id) && !is_user_alive(i)) {
            
message_begin(MSG_ONEszSayText, {000}, i)
            
write_byte(id)
            
write_string(arg)
            
message_end();
        } 
    }
    return 
PLUGIN_CONTINUE;
}

bool:is_valid_msg(const arg[]) {
    if(
arg[0] == '@' || !strlen(arg)) { 
        return 
false
    
}
    return 
true

__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
 


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 07:44.


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